Aug 11

This post is also available in: German

Let’s have a look on an 2 similar methods:

public static void checkStatus_array (Employee [] a){ … }
public static void checkStatus_list (List<Employee> a){ … }

Intentionally they should work similar, what do you think?

First of all the definitions:

List <Employee> a= new ArrayList <Employee>();
a.add(new SalesPerson());
a.add(new ControllingStaff());

Employee b [] = {new SalesPerson(), new ControlingStaff ()};

Calling the own methods is smoothly:


In contradiction calling the methods of each other lead to CompilerError:


  • Print
  • Facebook
  • Twitter
  • Google Bookmarks
  • Add to favorites
  • RSS
  • Blogosphere
  • email
  • PDF
  • Wikio
  • Technorati
  • Digg
  • DZone

Leave a Reply

preload preload preload Blog Top Liste - by Blogverzeichnis - Blog Verzeichnis Software
Webbhotell Top Blogs