Is it compulsory to use hibernate.cfg.xml for configuration in hibernate?
What should the return type be for a method that has no return value?
What is the output of the following Java code?
public class Abekus {
public static void main(String[] args) {
System.out.println('A' + 'b' + 'e' + 'k' + 'u' + 's');
}
}
What is the output of the following Java code?
class Abekus {
public static void main(String[] args)
{
try
{
System.out.println(10/0);
}
}
}
What is the output of the following Java code?
class Abekus {
public static void main(String[] args)
{
throw new Abekus();
System.out.println("Welcome to Abekus");
}
}
What is the output of the following Java code?
public class Test {
public static void main(String[] args) {
int x = 6;
float y = 9, z;
z = x * y;
System.out.println(x * y);
}
}
Predict the output of the following Java code:
public class Abekus
{
public static void main(String[] args)
{
int i = 7, j = 8 + --i;
int k = --i + ++i / j++ * i++ + ++j % i--;
System.out.println(k);
}
}
class A{
final int i=20;
}
class B extends A{
final int i=30;
}
class C extends B{
int i=40;
}
class testcase extends C{
int i=50;
public static void main(String args[]){
testcase obj = new A();
System.out.println(obj.i);
}
}
//Predict the output
import java.util.Scanner;
public class Main
{
public static void main(String args[])
{
StringBuilder str = new StringBuilder("WelcomeWorld");
int codepoints = str.codePointCount(1, 8);
System.out.println(codepoints);
}
}
What will be the code output?
//First Class definition.
package com.pk3;
class Abekus{
protected void m1()
{
System.out.println("Protected method of Abekus has been called.");
}
}
//Second class definition.
package com.pkg2;
import com.pk3.Abekus;
public class def extends Abekus {
public static void main(String args[]) {
def d=new def();
d.m1();
}
}
Note: Two classes are there.class def inherit the class Abekus.