- /**
- * Demonstrates how multiple classes
can be used in a program to help
- * organize it so that other
programmers can easily read and modify
- * the code. Classes are similar to
the chapters in a book.
- *
- * Unlike this simple example, a real
world program might have
- * thousands of lines of code.
- *
- * @author TK Rogers
- * @version 7-28-11
- */
- public class Hello2Class {
- public static void
main ( ) {
-
// Methods are small segments of code that can be run as
many times
-
// as needed. When a method is called, it runs.
-
Boys.speaker.talk ( ) ; // Calls the talk method from
the Boys class
-
Girls.speaker.talk ( ) ; // Calls the talk method from
the Girls class
-
System.out.println ( "Hello from the Hello2Class."
) ;
- }
- }