The BASE for JAVA LEARNING

by PRO FE S S OR


QUIZ for SECTION II

To find an answer, click on the desired question.


QUESTION 1:

What's the symbol that represents the 'begin' and 'end' statement for a class, a method, a construct ?

QUESTION 2:

When commenting out many lines of code, what symbol would you use ?

QUESTION 3:

How many 'main' methods can we have for a JAVA project ?

QUESTION 4:

True or False? The 'main' method is defined outside a class.

QUESTION 5:

Ture or False? The following code yields a compiler error.
class Exercise
{ public static void Main(String[] args)
{ System.out.println("Hello"); }
}

QUESTION 6:

The following code yields a compiler error. What's wrong with it ?
class Exercise
{ public static void main(String[] args)
{ System.out.println("Hello") }
}

QUESTION 7:

What's the diference between print() and println() ?

QUESTION 8:

If you use the Input.class bytecode provided in the Mini-course, (has to be in the same directory of your program) what's expected when the following code is executed ?
class Exercise
{ public static void main(String[] args)
{ int number = Input.enterInt();
System.out.println(number);
}
}


ANSWER to QUESTION 1:

Curly braces { }


Click your Back Button on your Browser to go back to the QUIZ Section.





















ANSWER to QUESTION 2:

Symbols: /* at the beginning and */ at the end.


Click your Back Button on your Browser to go back to the QUIZ Section.





















ANSWER to QUESTION 3:

We can only have 1 'main' method in any JAVA Project.


Click your Back Button on your Browser to go back to the QUIZ Section.





















ANSWER to QUESTION 4:

FALSE. The 'main' method as any other method has to be defined within a class.


Click your Back Button on your Browser to go back to the QUIZ Section.





















ANSWER to QUESTION 5:

FALSE. The 'Main' method is not the same as the 'main' method, but that's not a reason for the compiler to yield an error. This is just a method with the name 'Main'. JAVA is case sensitive.


Click your Back Button on your Browser to go back to the QUIZ Section.





















ANSWER to QUESTION 6:

Semi-colon is missing at the end of the display line: System.out.println("Hello");


Click your Back Button on your Browser to go back to the QUIZ Section.





















ANSWER to QUESTION 7:

The method 'print()' does not display a carriage return/line feed at the end of the console display. The method 'println()' does.


Click your Back Button on your Browser to go back to the QUIZ Section.





















ANSWER to QUESTION 8:

When execution, the system waits for an integer to be inputted via the keyboard, then after that is done, it will display the integer entered.


Click your Back Button on your Browser to go back to the QUIZ Section.





Click here to go to the JAVA Mini-Course page