What is the result of expression 5.45 + "3,2"?
a)The double value 8.6 b)The string ""8.6" c)The long value 8. d)The String "5.453.2" Ans :d
What are the values of x and y ?
x = 5; y = ++x; Ans : x = 6; y = 6
What are the values of x and z?
x = 5; z = x++;
Ans : x = 6; z = 5
Control Statements
1) What are the programming constructs?
Ans: a) Sequential
b) Selection -- if and switch statements
c) Iteration -- for loop, while loop and do-while loop
2) class conditional {
public static void main(String args[]) {
int i = 20;
int j = 55;
int z = 0;
z = i < j ? i : j; // ternary operator
System.out.println("The value assigned is " + z);
}
}
What is output of the above program?
Ans: The value assigned is 20
The switch statement does not require a break.
a)True
b)False
Ans: b.
conditional operator is otherwise known as the ternary operator.
a)True
b)False
Ans: a.
The while loop repeats a set of code while the condition is false.
a)True
b)False
Ans:b.
SOFTWARE COMPANIES
RESUME PREPRATION
INTERVIEW TIPS
C QUESTIONS
chapter 1
chapter 2
chapter 3
chapter 4
chapter 5
chapter 6
chapter 7
chapter 8
chapter 9
chapter 10
View All
DATA STRUCTURE
TECHNICAL QUESTIONS
JAVA
First chapter
Second chapter
Third chapter
Fourth chapter
Fifth chapter
Sixth chapter
Seventh chapter
Eight chapter
ninth chapter
Tenth chapter
eleventh chapter
Twevelth chapter
View All
FILE EXTENSION