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
______ is a measure of how well a program runs under various conditions.
Anonymous Quiz
0%
a) Secure
68%
b) Robust
15%
c) Reliable
17%
d) Scalable
What does it mean that Java is distributed?
Anonymous Quiz
5%
a) Java supports cloud storage
33%
b) Java programs can be deployed on multiple devices
55%
c) Java applications can open and access objects across the net via URLs
8%
d) Java uses distributed memory
How are Java programs processed?
Anonymous Quiz
87%
a) Compiled and interpreted
3%
b) Interpreted and compiled
8%
c) Compiled only
3%
d) Interpreted only
What are the naming conventions for classes and methods in Java?
Anonymous Quiz
58%
a) PascalCase for classes and camelCase for methods
26%
b) camelCase for classes and PascalCase for methods
8%
c) Both PascalCase
8%
d) Both camelCase
Note:
Java programs are compiled into bytecode and then interpreted or compiled using Just-In-Time (JIT) compilation at runtime.
@AceCoding
Java programs are compiled into bytecode and then interpreted or compiled using Just-In-Time (JIT) compilation at runtime.
@AceCoding
Which of these is NOT a keyword in Java?
Anonymous Quiz
0%
a) static
5%
b) abstract
54%
c) include
41%
d) transient
Why do we write String with an uppercase S?
Anonymous Quiz
26%
a) It is a convention for data types in Java
63%
b) It is a class in Java, not a primitive type
3%
c) To make it case-sensitive
8%
d) To differentiate it from arrays
How many methods are defined in the String class?
Anonymous Quiz
22%
a) 20
20%
b) 30
54%
c) 50
5%
d) 60