How many ways are there to define a named query in Hibernate?
Predict the output of the following Java code.
After compilation, the compiled code does not contain the import statement.
Predict the output of the following Java program.
In java, what is the use of Scanner class?
Which of these methods of the Java String class is used to extract a single character from a String object?
class test{
public static void main (String[] args) {
int sum = 0;
for (int i = 0, j = -2; (i^j)>0; ++i, j = i + 1)
sum += i;
System.out.println(sum);
}
}
Statement 1- Class declared as static
Statement 2- method declared as static
Statement 3- object declared as static
Predict the output of the following Java code:
class Abekus {
public static void main(String args[])
{
String s1 = new String("Abekus");
String s2 = new String("Abekus");
if (s1 == s2)
System.out.println("Hello Coder");
else
System.out.println("Hello Intern");
}
}
What will be the output of the following Java code?
class Access
{
public int x;
private int y;
void cal(int a, int b)
{
x = a + 1;
y = b;
}
}
public class AccessSpecifier
{
public static void main(String[] args)
{
Access obj = new Access();
obj.cal(2, 3);
System.out.println(obj.x + " " + obj.y);
}
}