1.
All methods must have the following:
Correct Answer
B. Parenthesis
Explanation
All methods must have parenthesis because they are used to enclose the arguments or parameters that are passed to the method. The parenthesis indicate where the method begins and ends, and they are necessary for the method to be properly executed. Without parenthesis, the method would not be able to receive any input or perform any actions. Therefore, parenthesis are a crucial component of any method in order for it to function correctly.
2.
The IDE we use in class is:
Correct Answer
C. Eclipse
Explanation
Eclipse is the correct answer because it is mentioned as one of the options provided for the IDE used in class.
3.
The correct declaration of a integer named i is:
Correct Answer
C. Int i;
Explanation
The correct declaration of an integer named i is "int i;". This statement declares a variable named i of type integer.
4.
Adding additional classes to a program is done using what keyword?
Correct Answer
D. Import
Explanation
In programming, the keyword "import" is used to add additional classes or libraries to a program. It allows the program to access and use the functionalities provided by the imported classes. By using the "import" keyword, the program can include and utilize code from external sources, making it easier to reuse code and extend the functionality of the program.
5.
What is missing from the following Java statement?gradeNumber = gradeNumber + 40
Correct Answer
B. Semi colon
Explanation
The missing element from the given Java statement is a semi colon. In Java, a semi colon is used to mark the end of a statement. Without a semi colon, the statement is considered incomplete and will result in a compilation error. Therefore, the correct statement should be "gradeNumber = gradeNumber + 40;".