hello,
keerthi sir,
as you privide answers of asked questions has no serial no.as questions are and more then the questions asked.it has done by knowingly or some reason.and no explanation of answers.
as given below:
Find the o/p of the following
Q. 1
Which of the following return true?
- "john" == "john"
- "john".equals("john")
- "john" = "john"
- "john".equals(new Button("john"))
Select all correct answers.
Q. 2
Which of the following do not lead to a runtime error?
- "john" + " was " + " here"
- "john" + 3
- 3 + 5
- 5 + 5.5
Select all correct answers.
Q. 3
Which of the following are so called "short circuit" logical operators?
- &
- ||
- &&
- |
Select all correct answers.
Q. 4
Which of the following are acceptable?
- Object o = new Button("A");
- Boolean flag = true;
- Panel p = new Frame();
- Frame f = new Panel();
- Panel p = new Applet();
Select all correct answers.
Q. 5
What is the result of compiling and running the following code:
public class Test {
static int total = 10;
public static void main (String args []) {
new Test();
}
public Test () {
System.out.println("In test");
System.out.println(this);
int temp = this.total;
if (temp > 5) {
System.out.println(temp);
}
}
}
- The class will not compile
- The compiler reports and error at line 2
- The compiler reports an error at line 9
- The value 10 is one of the elements printed to the standard output
- The class compiles but generates a runtime error
Select all correct answers.
Q 6
Which of the following is correct:
- String temp [] = new String {"j" "a" "z"};
- String temp [] = { "j " " b" "c"};
- String temp = {"a", "b", "c"};
- String temp [] = {"a", "b", "c"};
Select the most appropriate answer.
Answers
13. A, B
14. A, B, C, D
15.B, C
16. A, E
17. D
18. D
19. A