Java is a powerful general-purpose programming language.
| # | Quiz |
|---|---|
|
1
Discuss
|
JRE
Which component is responsible to run java program?
Solution |
|
2
Discuss
|
JDK
Which component is used to compile, debug and execute java program?
Solution |
|
3
Discuss
|
JVM
What is the extension of java code files?
Solution |
|
4
Discuss
|
JVM
Which component is responsible for converting bytecode into machine specific code?
Solution |
|
5
Discuss
|
JVM
Which component is responsible to optimize bytecode to machine code?
Solution |
|
6
Discuss
|
JVM
What is the extension of compiled java classes?
Solution |
|
7
Discuss
|
JVM
How can we identify whether a compilation unit is class or interface from a .class file?
Solution |
|
8
Discuss
|
JVM
What is use of interpreter?
SolutionAn interpreter is a software program that implements JVM (Java Virtual Machine) and converts bytecode into machine format, which is then executed on the host machine. |
|
9
Discuss
|
JVM
JVM Stands for ________________.
Solution |
|
10
Discuss
|
Variable
Which of these is long data type literal?
Solution |
|
11
Discuss
|
Variable
Which of these can be returned by the operator &?
Solution |
|
12
Discuss
|
Variable
What will be the output of the following Java program?
Solution |
|
13
Discuss
|
Variable
What will be the output of the following Java program?
Solution |
|
14
Discuss
|
Variable
What will be the output of the following Java program?
Solution |
|
15
Discuss
|
Variable
What will be the output of the following Java program?
Solution |
|
16
Discuss
|
Variable
Which of these can not be used for a variable name in Java?
Solution |
|
17
Discuss
|
Datatype
Which data type value is returned by all transcendental math functions?
Solution |
|
18
Discuss
|
Datatype
Which of these literals can be contained in float data type variable?
Solution |
|
19
Discuss
|
Datatype
An expression involving byte, int, and literal numbers is promoted to which of these?
Solution |
|
20
Discuss
|
Datatype
Which of the following are legal lines of Java code? 1. int w = (int)888.8; 2. byte x = (byte)100L; 3. long y = (byte)100; 4. byte z = (byte)100L;
Solution |
|
21
Discuss
|
Datatype
What is the range of byte data type in Java?
Solution |
|
22
Discuss
|
Datatype
What is the range of short data type in Java?
Solution |
|
23
Discuss
|
Datatype
What will be the output of these statement?
Solution |
|
24
Discuss
|
Datatype
What will be the output of the following Java code? - Average
Solution |
|
25
Discuss
|
Datatype
What will be the output of the following Java code? - Increment / Decrement
Solution |
|
26
Discuss
|
Datatype
What will be the output of the following Java code? - Area Of Circle
Solution |
|
27
Discuss
|
Datatype
Which of the below data type doesn’t support overloaded methods for +,-,* and /?
Solution |
|
28
Discuss
|
Datatype
What is the numerical range of a char data type in Java?
Solution |
|
29
Discuss
|
Datatype
What is the numerical range of a char data type in Java?Which of these coding types is used for data type characters in Java?
Solution |
|
30
Discuss
|
Datatype
Which of these values can a boolean variable contain?
Solution |
|
31
Discuss
|
Datatype
Which one is a valid declaration of a boolean?
Solution |
|
32
Discuss
|
Datatype
What is the output of this program?
Solution |
|
33
Discuss
|
Datatype
What is the output of this program?
Solution |
|
34
Discuss
|
Datatype
Which of the following is the advantage of BigDecimal over double?
Solution |
|
35
Discuss
|
Datatype
What is the output of below code snippet?
Solution |
|
36
Discuss
|
Datatype
What is the base of BigDecimal data type?
Solution |
|
37
Discuss
|
Operator
Which of the following can be operands of arithmetic operators?
Solution |
|
38
Discuss
|
Operator
Modulus operator, %, can be applied to which of these?
Solution |
|
39
Discuss
|
Operator
With x = 0, which of the following are legal lines of Java code for changing the value of x to 1? 1. x++; 2. x = x + 1; 3. x += 1; 4. x =+ 1;
Solution |
|
40
Discuss
|
Operator
What will be the output of the following Java program?
Solution |
|
41
Discuss
|
Operator
Can 8 byte long data type be automatically type cast to 4 byte float data type?
Solution |
|
42
Discuss
|
Operator
What will be the output of the following Java program?
Solution |
|
43
Discuss
|
Operator
What will be the output of the following Java program?
Solution |
|
44
Discuss
|
Operator
Which of these statements are incorrect?
Solution |
|
45
Discuss
|
Operator
Decrement operator, −−, decreases the value of variable by what number?
Solution |
|
46
Discuss
|
Operator
Which of these is not a bitwise operator?
Solution |
|
47
Discuss
|
Operator
What will be the output of the following Java program?
Solution |
|
48
Discuss
|
Operator
What will be the output of the following Java program?
Solution |
|
49
Discuss
|
Operator
What will be the output of the following Java program?
Solution |
|
50
Discuss
|
Operator
What will be the output of the following Java program?
Solution |
|
51
Discuss
|
Operator
What will be the output of the following Java program?
Solution |
|
52
Discuss
|
Operator
Which of these statements are incorrect?
Solution |
|
53
Discuss
|
Operator
Which right shift operator preserves the sign of the value?
Solution |
|
54
Discuss
|
Operator
On applying Left shift operator, <<, on integer bits are lost one they are shifted past which position bit?
Solution |
|
55
Discuss
|
Operator
Which operator is used to invert all the digits in a binary representation of a number?
Solution |
|
56
Discuss
|
Operator
What is the output of relational operators?
Solution |
|
57
Discuss
|
Operator
What will be the output of the following Java code?
Solution |
|
58
Discuss
|
Operator
What will be the output of the following Java code?
Solution |
|
59
Discuss
|
Operator
What will be the output of the following Java code?
Solution |
|
60
Discuss
|
Operator
What will be the output of the following Java code?
Solution |
|
61
Discuss
|
Operator
What will be the output of the following Java code?
Solution |
|
62
Discuss
|
Operator
Which of these statements is correct?
Solution |
|
63
Discuss
|
Operator
Which of these operators can skip evaluating right hand operand?
Solution |
|
64
Discuss
|
Operator
Which of the following operators can operate on a boolean variable? 1. && 2. == 3. ?: 4. +=
Solution |
|
65
Discuss
|
Operator
Which of these is returned by “greater than”, “less than” and “equal to” operators?
Solution |
|
66
Discuss
|
Operator
What will be the output of the following Java program?
Solution |
|
67
Discuss
|
Operator
Which of these lines of Java code will give better performance? 1. a | 4 + c >> b & 7; 2. (a | ((( 4 * c ) >> b ) & 7 ))
Solution |
|
68
Discuss
|
Operator
What will be the output of the following Java code?
Solution |
|
69
Discuss
|
Operator
What will be the output of the following Java code?
Solution |
|
70
Discuss
|
Operator
What will be the output of the following Java code?
Solution |
|
71
Discuss
|
Operator
Which of these statements are incorrect?
Solution |
|
72
Discuss
|
Operator
What is the order of precedence (highest to lowest) of following operators?
1. &
2. ^
3. ?:
Solution |
|
73
Discuss
|
Operator
What is the value stored in x in the following lines of Java code?
int x, y, z;
x = 0;
y = 1;
x = y = z = 8;
Solution |
|
74
Discuss
|
Operator
What should be expression1 evaluate to in using ternary operator as in this line? expression1 ? expression2 : expression3
Solution |
|
75
Discuss
|
Operator
Which of these have highest precedence?
Solution |
|
76
Discuss
|
If-else
Which of these are selection statements in Java?
Solution |
|
77
Discuss
|
If-else
What will be the output of the following Java program?
Solution |
|
78
Discuss
|
If-else
What will be the output of the following Java program?
Solution |
|
79
Discuss
|
If-else
What would be the output of the following code snippet if variable a=10?
Solution |
|
80
Discuss
|
Switch
Which of these selection statements test only for equality?
Solution |
|
81
Discuss
|
Switch
Which of this statement is incorrect?
Solution |
|
82
Discuss
|
Switch
What will be the output of the following Java program?
Solution |
|
83
Discuss
|
Switch
What is the valid data type for variable “a” to print “Hello World”?
Solution |
|
84
Discuss
|
For
What will be the output of the following Java program?
Solution |
|
85
Discuss
|
While
What will be the output of the following Java program?
Solution |
|
86
Discuss
|
While
The while loop repeats a set of code while the condition is not met?
Solution |
|
87
Discuss
|
do-while
Which of the following loops will execute the body of loop even when condition controlling the loop is initially false?
Solution |
|
88
Discuss
|
do-while
What is true about do statement?
Solution |
|
89
Discuss
|
do-while
Which of the following is not a decision making statement?
Solution |
|
90
Discuss
|
break
What is true about a break?
Solution |
|
91
Discuss
|
break
Which of the following is used with the switch statement?
Solution |
|
92
Discuss
|
break
From where break statement causes an exit?
Solution |
|
93
Discuss
|
continue
Which of these jump statements can skip processing the remainder of the code in its body for a particular iteration?
Solution |
|
94
Discuss
|
About OOPs
Which of the following is not OOPS concept in Java?
Solution |
|
95
Discuss
|
About OOPs
What is it called if an object has its own lifecycle and there is no owner?
SolutionAn Association uses a relationship where all objects have their own lifecycle and no owner. This occurs where many-to-many relationships are available, instead of one-to-one or one-to-many. |
|
96
Discuss
|
About OOPs
What is it called where child object gets killed if parent object is killed?
Solution |
|
97
Discuss
|
About OOPs
What is it called where object has its own lifecycle and child object cannot belong to another parent object?
Solution |
|
98
Discuss
|
Inheritance
Which of this keyword must be used to inherit a class?
Solution |
|
99
Discuss
|
Inheritance
What will be the output of the following Java program?
Solution |
|
100
Discuss
|
Inheritance
What will be the output of the following Java program?
Solution |
|
101
Discuss
|
Inheritance
What will be the output of the following Java program?
Solution |
|
102
Discuss
|
Inheritance
Which of these is correct way of inheriting class A by class B?
Solution |
|
103
Discuss
|
Inheritance
A class member declared protected becomes a member of subclass of which type?
Solution |
|
104
Discuss
|
Inheritance
What is not type of inheritance?
Solution |
|
105
Discuss
|
Inheritance
Does Java support multiple level inheritance?
Solution |
|
106
Discuss
|
Inheritance
What would be the result if a class extends two interfaces and both have a method with same name and signature? Lets assume that the class is not implementing that method.
Solution |
|
107
Discuss
|
Inheritance
Which of the following is used in implementing inheritance through class?
Solution |
|
108
Discuss
|
Inheritance
Which of the following is used for implementing inheritance through an interface?
Solution |
|
109
Discuss
|
Inheritance
Static members are not inherited to subclass.
Solution |
|
110
Discuss
|
Inheritance
If super class and subclass have same variable name, which keyword should be used to use super class?
Solution |
|
111
Discuss
|
Inheritance
In order to restrict a variable of a class from inheriting to subclass, how variable should be declared?
Solution |
|
112
Discuss
|
Inheritance
All classes in Java are inherited from which class?
Solution |
|
113
Discuss
|
Inheritance
Using which of the following, multiple inheritance in Java can be implemented?
Solution |
|
114
Discuss
|
Polymorphism (Runtime & Compile Time)
Which of the following is a type of polymorphism in Java?
Solution |
|
115
Discuss
|
Polymorphism (Runtime & Compile Time)
When does method overloading is determined?
Solution |
|
116
Discuss
|
Polymorphism (Runtime & Compile Time)
When Overloading does not occur?
Solution |
|
117
Discuss
|
Polymorphism (Runtime & Compile Time)
Method overriding is combination of inheritance and polymorphism?
Solution |
|
118
Discuss
|
Polymorphism (Runtime & Compile Time)
What is the process of defining a method in a subclass having same name & type signature as a method in its superclass?
Solution |
|
119
Discuss
|
Polymorphism (Runtime & Compile Time)
Which of these keywords can be used to prevent Method overriding?
Solution |
|
120
Discuss
|
Polymorphism (Runtime & Compile Time)
Which of these is supported by method overriding in Java?
Solution |
|
121
Discuss
|
Abstraction (Using abstract and interface)
Which concept of Java is a way of converting real world objects in terms of class?
Solution |
|
122
Discuss
|
Encapsulation
Which concept of Java is achieved by combining methods and attribute into a class?
Solution |
| # | Quiz |
Copyright © 2020 Inovatik - All rights reserved