Java MCQ - English
Which of the following are legal lines of Java code?
1 and 2
2 and 3
3 and 4
All statements are correct.
Answer : D
View More Related Question
1) Which of the following automatic type conversion will be possible?
2) What is the error in this code? byte b = 50;
b = b * 50;
b can not contain value 100, limited by its range.
* operator has converted b * 50 into int, which can not be converted to byte without casting.
b can not contain value 50.
No error in this code
View Answer
3) What is the prototype of the default constructor of this class? public class prototype { }
4) Which of these is necessary condition for automatic type conversion in Java?
The destination type is smaller than source type
The destination type is larger than source type
The destination type can be larger or smaller than source type
None of the mentioned
View Answer
5) What is Truncation is Java?
Floating-point value assigned to an integer type
Integer value assigned to floating type
Floating-point value assigned to an Floating type
Integer value assigned to floating type
View Answer