ExamVeda
Login
Home
61
What is the range of short data type in Java?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
62
Is SimpleDateFormat thread safe?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
63
Which of these can not be used for a variable name in Java?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
64
Are enums are type-safe?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
65
Which of the below data type doesn't support overloaded methods for +,-,* and /?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
66
How to convert a String to a Date object?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
67
What is BigDecimal.ONE?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
68
What will be the error in the following Java code?
byte b = 50;
b = b * 50;
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
69
Which of these values can a boolean variable contain?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
70
What will be the output of the following Java code?
class increment {
    public static void main(String args[]) 
    {        
         int g = 3;
         System.out.print(++g * 8);
    } 
}
Discuss
Answer & Solution
Answer: Option C
Solution:
The given Java code initializes a variable g with the value 3. It then uses the pre-increment operator (++) on g before multiplying it by 8 and printing the result using System.out.print.

The expression ++g * 8 is evaluated as follows:

++g increments the value of g to 4.
4 * 8 is equal to 32.
Therefore, the output of the code will be 32.