Dear Java Programmer:

 
Lab 1023_javaiinheritance 
Code 1.30 Modified Main.java
 
 
// Display the class hierarchy of the InternationalStudent
// class through getSuperclass() method of Class class.
Class class1 = internationalStudent1.getClass();
         
System.out.println("Displaying class hierarchy of InternationalStudent 
Class...");
        
 
  while (class1.getSuperclass() != null){ 
    String child = class1.getName();
    String parent = class1.getSuperclass().getName();
    System.out.println("  " + child + " class is a child class of " + parent);
    class1 = class1.getSuperclass();
   } 
 
I have a question about this while loop.  The expression is place in the ().  
But at the end the expression is placed into a variable.  How is the loop being 
incremented?  Do not understand logic here?  Please comment.
 
JKid314159


      
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to