Java Quiz Choose the correct answer to each question or statement. 1. In Java, t
ID: 3593102 • Letter: J
Question
Java Quiz
Choose the correct answer to each question or statement.
1. In Java, the result of 31 / 2 is _________________ .
None of the above.
2. Which of the following is not a primitive type in Java?
String
3. In Java, the result of 3.0 / 2 is _________________ .
None of the above.
4. The keyword for declaring a 64 bit integer in Java is __________.
5. The result of 2 * 9 % 4 is ________.
None of the above.
6. The accessors are the ________ methods.
7. The operations of a class, i.e., behaviors, are also called ________.
8. What is the output of this code fragment?
9. Which of the following expresses the condition: a is less than b or c
None of the above.
10. int age = 33;
if ( age >= 33 )
{
System.out.println( "apple" );
}
else
{
System.out.println( "orange" );
}
System.out.println( "beer" );
11. int age = 28;
if( age > 33 )
{
System.out.print( "apple" );
}
System.out.println( "orange" );
12. Which package does the JFrame class belong to?
13. When creating a GUI application class, which class do we typically extend?
14. In order to place a component to a JFrame, we use the ________ method.
15. When writing a class implementing ActionListener, which abstract method do we need to implement?
0Explanation / Answer
Answer:
1)15
2)string
3)1.5
5)2
6
7) methods
8) 12
9)
10)apple
11) orange
12)javax.swing
13)JFrame
14)add
a < b || a < cRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.