01.8 Java Types & Ops 8
Total points9/10
Duration: 20 Minutes
Email *
majorkiema.mk@gmail.com
Question 1 *
What will be the output of compiling and running the following ?
1/1
Captionless Image
Required
Question 2
Given the following code fragment :
1/1
What is the result ?
What is the result ?
Question 3
What will be the output of compiling and running the following code ?
1/1
Captionless Image
Question 4
Given :
0/1
Captionless Image
Correct answer
Question 5
Which type of primitive can be assigned a new value within a conditional expression ?
1/1
Question 6
What is the output of the following program ?
1/1
Captionless Image
Question 7
Which operator is used to compare two values, = or == ?
1/1
Feedback
The == operator is used for comparison, and = is used for assignment.
Question 8
What will be the output of the code given below ?
1/1
Captionless Image
Feedback
The code System.out.println(++i); evaluates to 6, because the prefix version of ++ evaluates to the incremented value. The next line, System.out.println(i++); evaluates to the current value (6), then increments by one. So "7" doesn't get printed until the next line.
Question 9
Given the following code :
1/1
What will be the output ?
What will be the output ?
Question 10
1/1
Captionless Image
This content is neither created nor endorsed by Google. Report Abuse - Terms of Service - Privacy Policy