Which keyword is used to inherit a class in Java?
Anonymous Quiz
31%
a) extend
57%
b) extends
4%
c) implement
8%
d) inherits
What is the default value of a boolean in Java?
Anonymous Quiz
20%
a) true
63%
b) false
10%
c) null
8%
d) 0
Which package is imported by default in Java?
Anonymous Quiz
35%
a) java.util
38%
b) java.lang
22%
c) java.io
5%
d) java.net
What is Math.PI in Java?
Anonymous Quiz
31%
a) A method
47%
b) A constant
2%
c) A variable
20%
d) A class
What is the purpose of the final keyword?
Anonymous Quiz
54%
a) Define constants
6%
b) Prevent inheritance
13%
c) Prevent method overriding
27%
d) All of the above
Which of these is NOT a valid Java keyword?
Anonymous Quiz
2%
a) static
0%
b) void
10%
c) null
88%
d) include
Java programs are compiled into ______.
Anonymous Quiz
72%
a) Bytecode
17%
b) Machine code
6%
c) Source code
6%
d) Executables
The default access modifier in Java is ______.
Anonymous Quiz
31%
a) public
6%
b) private
4%
c) protected
11%
d) package-private
49%
e) Default
The main method in Java must return ______.
Anonymous Quiz
4%
a) int
79%
b) void
13%
c) String
4%
d) boolean
The Scanner class is located in the ______ package.
Anonymous Quiz
4%
a) java.io
94%
b) java.util
2%
c) java.lang
0%
d) java.net
Why is the main method static in Java?
Anonymous Quiz
68%
a) To allow it to be called without creating an object
15%
b) To ensure it can access instance variables
0%
c) To make it faster
18%
d) To ensure it cannot be overridden
👍1
What is the use of goto in Java?
Anonymous Quiz
2%
a) It is used for loops
12%
b) It helps in error handling
71%
c) It allows jumping to labels in the code
15%
d) It is reserved but not used
What is the difference between a Java application and a Java applet?
Anonymous Quiz
78%
a) An application runs on the JVM, and an applet requires a browser
8%
b) An application is compiled, but an applet is interpreted
10%
c) An application is platform-specific, and an applet is platform-independent
5%
d) There is no difference
What are the 5 phases of a Java program?
Anonymous Quiz
9%
a) Write, Run, Debug, Test, Deploy
63%
b) Edit, Compile, Load, Verify, Execute
14%
c) Code, Compile, Debug, Build, Deploy
14%
d) Compile, Interpret, Load, Verify, Execute
Which type of error occurs when a program runs but produces incorrect results?
Anonymous Quiz
9%
a) Compile-time error
25%
b) Runtime error
59%
c) Logical error
7%
d) Syntax error
Java has a runtime ______ feature to provide programming support for robustness.
Anonymous Quiz
18%
a) Type checking
8%
b) Error reporting
20%
c) Debugging
55%
d) Exception handling