JAVA > Programming Basic
Set-1 Java Basics & Syntax
--:--
Submit Test
Question 1 of 15
Clear
Who is known as the creator of the Java programming language?
A
Dennis Ritchie
B
James Gosling
C
Bjarne Stroustrup
D
Guido van Rossum
Question 2 of 15
Clear
Which component of Java is responsible for converting bytecode into machine-specific code at runtime?
A
JDK
B
JRE
C
JVM
D
JIT Compiler Only
Question 3 of 15
Clear
What is the correct file extension for a compiled Java bytecode file?
A
.java
B
.class
C
.jar
D
.exe
Question 4 of 15
Clear
Which method serves as the entry point for execution in a standalone Java application?
A
public void start()
B
public static void main(String[] args)
C
static void run(String[] args)
D
public int main()
Question 5 of 15
Clear
What is the size of an 'int' primitive data type in Java?
A
2 bytes (16 bits)
B
4 bytes (32 bits)
C
8 bytes (64 bits)
D
Depends on the OS
Question 6 of 15
Clear
Which keyword is used to declare a constant variable whose value cannot be changed once assigned?
A
const
B
static
C
final
D
constant
Question 7 of 15
Clear
Which of the following is NOT a primitive data type in Java?
A
boolean
B
char
C
String
D
double
Question 8 of 15
Clear
What is the default value of an uninitialized 'boolean' instance variable in Java?
A
true
B
false
C
0
D
null
Question 9 of 15
Clear
Which statement is used to print text to the console followed by a new line in Java?
A
System.out.print()
B
System.out.println()
C
Console.WriteLine()
D
System.print.line()
Question 10 of 15
Clear
Which symbol is used to write a single-line comment in Java?
A
/* comment */
B
# comment
C
// comment
D
<!-- comment -->
Question 11 of 15
Clear
Which operator is used to compare two primitive values for equality in Java?
A
=
D
equals()
Question 12 of 15
Clear
Which class from the java.util package is commonly used to read user input from the keyboard?
A
BufferedReader
B
Scanner
C
InputReader
D
ConsoleInput
Question 13 of 15
Clear
What does the 'static' keyword indicate when applied to a method in Java?
A
The method cannot be overridden
B
The method belongs to the class rather than an instance
C
The method returns no value
D
The method is private to the package
Question 14 of 15
Clear
Which of the following is a valid variable identifier in Java?
A
2ndValue
B
class
C
_totalScore
D
first-name
Question 15 of 15
Clear
Which Java feature allows the same compiled bytecode to run on any operating system with a JVM?
A
Multithreading
B
Encapsulation
C
Platform Independence (WORA)
D
Dynamic Binding
Finish & Submit Exam
Question Palette
0 / 15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Answered
Not Answered
Submit Final Answers
Privacy Policy