Menu
Java Tutorial
Exception Handling
Exception handling
MongoDB Tutorial
MongoDB Tutorial
String
String
Exception Handling
Question/Answer
Exception Handling
Quiz
Java Basic Quiz-1
Admin
Monday, June 17, 2024
Java Basics Quiz 1
Java Basics Quiz 1
Time left: 10:00
1.
What is the correct syntax for the main method in Java?
public static void main(String[] args)
public static void Main(String[] args)
public void main(String[] args)
public static void main(String args)
Answer
Reset
2.
What is the size of int in Java?
16-bit
32-bit
64-bit
8-bit
Answer
Reset
3.
Which of the following is not a Java keyword?
static
Boolean
void
private
Answer
Reset
4.
What is the default value of a boolean variable in Java?
true
false
0
1
Answer
Reset
5.
Which method must be implemented by all threads?
start()
stop()
run()
main()
Answer
Reset
6.
Which of the following is not a primitive data type in Java?
int
float
String
char
Answer
Reset
7.
What is the result of 10 + 20 + "30" in Java?
1030
3030
1230
102030
Answer
Reset
8.
What is the output of the following code?
int x = 5; int y = 10; x = y; y = x; System.out.println(x + ", " + y);
5, 10
10, 5
10, 10
5, 5
Answer
Reset
9.
What is the use of the "final" keyword in Java?
To mark a variable as read-only
To prevent method overriding
To prevent inheritance
All of the above
Answer
Reset
10.
Which of the following is true about interfaces in Java?
Interfaces can have concrete methods
Interfaces can have constructors
Interfaces can be instantiated
Interfaces can have default methods
Answer
Reset
Submit Quiz
0 Comments
Contact form
0 Comments