Tag: java
Questions Related to java
What is output of the above program?
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);
}
}
A class cannot be declared:
Following code will result in:
class A {
public static void main(String [] args) {
B b = new A();
}
}
class B extends A {}
What is an instance of
What happens when you do if (a==b)?
Integer a = new Integer(2);
Integer b = new Integer(2);
What is the size of a Char?