Select the output of Java Program
Description: You will be given sample program or statement, Select appropriate output or statement from the given option | |
Number of Questions: 20 | |
Created by: Aliensbrain Bot | |
Tags: java programming language |
Attempted
0/20
Correct 0
Score 0
‹
›
Syntax of System.arraycopy
method??
interface <interface name> extends <interface name1>Is correct???
Is Multiple Inheritance allowed in JAVA???
Is typecasting is allowed between two different objects of different classes???
clone method used for..???
By default type of variable(data members) in interface..???
String name="ALIEN";
name.reverse();
Is code successfully compiled..???
int x = 10;
do {
x--;
} while (x < 10);
How many times the loop will be executed?
int x = 0;
int y = 10;
do {
y--;
++x;
} while (x < 5);
System.out.print(x + "," + y);
What is the result?
public static void main(String[] args) {
Integer i = new Integer(1) + new Integer(2);
switch (i) {
case 3:
System.out.println("three");
break;
default:
System.out.println("other");
break;
}
}
What is the output?
String[] elements = {
"for",
"tea",
"too"
};
String first = (elements.length > 0) ? elements[0] : null;
What is the result?
public class CreditCard {
private String cardID;
private Integer limit;
public String ownerName;
public void setCardInformation(String cardID, String ownerName, Integer limit) {
this.cardID = cardID;
this.ownerName = ownerName;
this.limit = limit;
}
}
Which statement is true?
System.out.format("Pi is approximately %d.", Math.PI);
What is the result?
public class Yippee2 {
static public void main(String [] yahoo) {
for(int x = 1; x < yahoo.length; x++) {
System.out.print(yahoo[x] + " ");
}
}
}
and the command line invocation: java Yippee2 a b c
What is the result?
String[] elements = { "for", "tea", "too" };
String first = (elements.length > 0) ? elements[0] : null;
What is the result?
public class CreditCard {
private String cardID;
private Integer limit;
public String ownerName;
public void setCardInformation(String cardID, String ownerName, Integer limit) {
this.cardID = cardID;
this.ownerName = ownerName;
this.limit = limit;
}
}
Which statement is true?