How would you use a method that belongs to an object that is part of the array? Use an example and demonstrate with Java code.

What will be an ideal response?


To use a method that belongs to an object that is part of an array, you insert the appropriate subscript notation after the array name and before the dot that precedes the method name. For example, to display data for seven Employees stored in the emps array, you can write the following:??for(int x = 0; x < emps.length; ++x)
   System.out.println (emps[x].getEmpNum() + " " + emps[x].getSalary());

Computer Science & Information Technology

You might also like to view...

By adding the ____ property to an object in Flash, you can create an illusion of depth, where an object appears to be closer to or farther away from other objects.

A. d B. 3d C. s D. z

Computer Science & Information Technology

What are the perceptual organization principles?

What will be an ideal response?

Computer Science & Information Technology

You can use a bubble sort to arrange records in either ascending or descending order.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

A password must be entered to protect a document

Indicate whether the statement is true or false

Computer Science & Information Technology