<< Chapter < Page | Chapter >> Page > |
public static void main(String[] args)
False. Class methods can be called by joining the name of the class with the name of the method using a period.
Each class definition results in a separate class file regardless of whether or not the classes are defined in separate source files.
One of the files must have the same name as the controlling class with an extension of class .
False.
Listing 2. Listing for Answer 7. |
---|
/** special documentation comment used by the JDK javadoc tool */
/* C/C++ style multi-line comment */// C/C++// C/C++ style single-line comment |
Listing 3. Listing for Answer 6. |
---|
/*File Name01.java
This is a Java application that will display aname on the standard output device.
The command required at the command line to execute thisprogram is:
java Name01**********************************************************/
class Name01 { //define the controlling classpublic static void main(String[] args){ //define mainSystem.out.println(
"Dick Baldwin\nAustin Community College\nAustin, TX");}//end main
}//End Name01 class. |
Note that the \n characters in Listing 3 cause the output display to advance to the next line.
True.
Preface or precede the name of the method with the static keyword.
The name of the class file must be the same as the name of the class that contains the main method (sometimes called the controlling class) .
False. Applets do not require a main method while applications do require a main method.
False. Applications are for stand-alone use while applets are for browsers.
This section contains a variety of miscellaneous information.
Financial : Although the Connexions site makes it possible for you to download aPDF file for this module at no charge, and also makes it possible for you to purchase a pre-printed version of the PDF file, youshould be aware that some of the HTML elements in this module may not translate well into PDF.
I also want you to know that, I receive no financial compensation from the Connexions website even if you purchase the PDF version ofthe module.
In the past, unknown individuals have copied my modules from cnx.org, converted them to Kindle books, and placed them for sale onAmazon.com showing me as the author. I neither receive compensation for those sales nor do I know who does receive compensation. If youpurchase such a book, please be aware that it is a copy of a module that is freely available on cnx.org and that it was made andpublished without my prior knowledge.
Affiliation : I am a professor of Computer Information Technology at Austin Community College in Austin, TX.
-end-
Notification Switch
Would you like to follow the 'Object-oriented programming (oop) with java' conversation and receive update notifications?