Java Basics Quiz 2 - Java Basics Question and Answers | JAVA Test
Finish Quiz
0 of 20 questions completed
Questions:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
Information
Let’s Play with our Java Basics Test Quiz 2 and test your basic Java Fundamentals. By using below Free Java Basics Quiz you may test your study yourself. Java Basics Test Quiz 2 Question and Answers 2024. Java online Test Quiz 2. Java Basics Quiz 2 Free Mock Test 2024. Java Basics Test Quiz 2 Question and Answers in PDF. The Java online mock test paper is free for all students. Java Basics Test is very useful for exam preparation and getting for Rank. Java Basics Test Quiz 2 Question and Answers in English. Java Basics Mock test for topic via Basics Mode. Here we are providing Java Basics Mock Test in English Now Test your self for “Java Basics Test in English” Exam by using below quiz…
This paper has 20 questions.
Time allowed is 25 minutes.
The Java Basics Mock Test is Very helpful for all students. Now Scroll down below n click on “Start Quiz” or “Start Test” and Test yourself.
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading...
You must sign in or sign up to start the quiz.
You have to finish following quiz, to start this quiz:
Results
0 of 20 questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 points, (0)
Average score |
|
Your score |
|
Categories
- Not categorized 0%
Pos. | Name | Entered on | Points | Result |
---|---|---|---|---|
Table is loading | ||||
No data available | ||||
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- Answered
- Review
-
Question 1 of 20
1. Question
What is essential in making sure that your loop is not infinite ?
Correct
Incorrect
-
Question 2 of 20
2. Question
What displays from the following statements? String word = “abcde”; for (int i = 0; i <4; i+=2) System.out.print(word[i]);
Correct
Incorrect
-
Question 3 of 20
3. Question
Which is NOT a section of all types of loops ?
Correct
Incorrect
-
Question 4 of 20
4. Question
What is a loop ?
Correct
Incorrect
-
Question 5 of 20
5. Question
Can you compare a boolean to an integer?
Correct
Incorrect
-
Question 6 of 20
6. Question
Primitive datatypes are allocated on a stack.
Correct
Incorrect
-
Question 7 of 20
7. Question
Following code will result in: int a1 = 5; double a2 = (float)a1;
Correct
Incorrect
-
Question 8 of 20
8. Question
Java runs on _______.
Correct
Incorrect
-
Question 9 of 20
9. Question
What is the size of a Char in Java?
Correct
Incorrect
-
Question 10 of 20
10. Question
A null reference may be used to access a static variable or method.
Correct
Incorrect
-
Question 11 of 20
11. Question
What gets printed when the following code is compiled and run with the following command – java test 2 Select the one correct answer.
public class test {
public static void main(String args[]) {
Integer intObj=Integer.valueOf(args[args.length-1]);
int i = intObj.intValue();if(args.length > 1)
System.out.println(i);
if(args.length > 0)
System.out.println(i – 1);
else
System.out.println(i – 2);
}
}Correct
Incorrect
-
Question 12 of 20
12. Question
Which of the following statements is false about objects?
Correct
Incorrect
-
Question 13 of 20
13. Question
Which of these are legal identifiers. Select the three correct answers.
a. number_1
b. number_a
c. $1234
d. -volatileCorrect
Incorrect
-
Question 14 of 20
14. Question
The class Hashtable is used to implement which collection interface. Select the one correct answer.
Correct
The collection interface Map has two implementation HashMap and Hashtable.
Incorrect
The collection interface Map has two implementation HashMap and Hashtable.
-
Question 15 of 20
15. Question
TreeMap class is used to implement which collection interface. Select the one correct answer.
Correct
Incorrect
-
Question 16 of 20
16. Question
Given a one dimensional array arr, what is the correct way of getting the number of elements in arr. Select the one correct answer.
Correct
Incorrect
-
Question 17 of 20
17. Question
What happens when the following code is compiled and run. Select the one correct answer.
for(int i = 1; i < 3; i++)
for(int j = 3; j > i; j–)
assert i!=j {System.out.println(i); }Correct
The condition in assert statement must be followed by a semi-colon.
Incorrect
The condition in assert statement must be followed by a semi-colon.
-
Question 18 of 20
18. Question
What gets displayed on the screen when the following program is compiled and run. Select the one correct answer.
protected class example {
public static void main(String args[]) {
String test = “abc”;
test = test + test;
System.out.println(test);
}
}Correct
Incorrect
-
Question 19 of 20
19. Question
In the following class definition, which is the first line (if any) that causes a compilation error. Select the one correct answer.
public class test {
public static void main(String args[]) {
char c;
int i;
c = ‘A’; // 1
i = c; //2
c = i + 1; //3
c++; //4
}
}Correct
It is not possible to assign an integer to a character in this case without a cast.
Incorrect
It is not possible to assign an integer to a character in this case without a cast.
-
Question 20 of 20
20. Question
Which of the following is a Java keyword. Select the four correct answers.
a. extern
b. synchronized
c. volatile
d. friend
e. friendly
f. transient
g. this
h. thenCorrect
Incorrect