Can a class be declared with a protected modifier in Java?
How many types of collection mapping are possible in Hibernate?
Which of the following is not an operator in Java?
What is the return type of a method that does not return any value?
Which of the following methods can convert an object to a list?
All the classes in Java are derived from which class?
What is the output of the following code?
class Test
{
public static void main(String args[])
{
int ascii[] = { 65, 66, 67, 68};
String s = new String(ascii, 1, 3);
System.out.println(s);
}
}
class test{
public static void main (String[] args) {
int x=10,y=15;
if(++x<10 && ++y>15)
{
x++;
}
else
{
y++;
}
System.out.println(x+" "+y);
}
}
What is the output of this program?
class Area
{
int breadth;
int length;
}
class mainclass
{
public static void main(String args[])
{
Area a = new Area();
a.breadth = 10;
a.length = 15;
int area = a.breadth * a.length;
System.out.print(area);
}
}
class method
{
public int i;
static int j;
void add(int a , int b)
{
i =++j + ++b;
j =++i + b++;
}
}
class output
{
public static void main(String args[])
{
method obj1 = new method();
method obj2 = new method();
int a = 5;
obj1.add(++a, ++a + 1);
obj2.add(6, a);
System.out.println(obj1.i+" "+obj2.j);
}
}