Vidyalelo
Java Programming · all questions

Java Autoboxing
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

90

Questions

4/5

Page

Pick an option on a question to see the right answer and solution.

Which of the following is not a core interface of Hibernate?

Select an option to see the answer and solution.

SessionFactory is a thread-safe object.

Select an option to see the answer and solution.

Which of the following methods returns proxy object?

Select an option to see the answer and solution.

Which of the following methods hits database always?

Select an option to see the answer and solution.

Which of the following method is used inside session only?

Select an option to see the answer and solution.

Which of the following is not a state of object in Hibernate?

Select an option to see the answer and solution.

Which of the following is not an inheritance mapping strategies?

Select an option to see the answer and solution.

Which of the following is not an advantage of using Hibernate Query Language?

Select an option to see the answer and solution.

In which file database table configuration is stored?

Select an option to see the answer and solution.

Which of the following is not an advantage of Hibernate Criteria API?

Select an option to see the answer and solution.

What does Liskov substitution principle specify?

Select an option to see the answer and solution.

What will be the correct option of the following Java code snippet?
interface ICust 
{
}
class RegularCustomer implements ICust 
{
}
class OneTimeCustomer implements ICust 
{
}

Select an option to see the answer and solution.

What will be the output of the following Java code snippet?
public class Shape 
{
	public int area()
        {
		return 1;
	}
}
public class Square extends Shape 
{
	public int area()
        {
		return 2;
	}
}
class Main() 
{
   public static void main(String[] args)
   {
	Shape shape = new Shape();
	Square square = new Square();
	shape = square;
	System.out.println(shape.area());
    }
}

Select an option to see the answer and solution.

What will be the output of the following Java code snippet?
public class Shape 
{
	public int area()
        {
		return 1;
	}
}
public class Rectangle extends Shape 
{
	public int area()
        {
		return 3;
	}
}
class Main() 
{
   public static void main(String[] args)
   {
	Shape shape = new Shape();
	Rectangle rect = new Rectangle();
	shape = rect;
	System.out.println(shape.area());
   }
}

Select an option to see the answer and solution.

What will be the output of the following Java code?
public class Shape 
{
	public int area()
        {
		return 1;
	}
}
public class Square extends Shape 
{
	public int area()
        {
		return 2;
	}
}
class Main() 
{
   public static void main(String[] args)
   {
	Shape shape = new Shape();
	Square square = new Square();
	square = shape;
	System.out.println(square.area());
   }
}

Select an option to see the answer and solution.

What will be the output of the following Java code?
public class Shape 
{
	public int area()
        {
		return 1;
	}
}
public class Square extends Shape 
{
	public int area()
        {
		return 2;
	}
}
public class Rectangle extends Shape 
{
	public int area()
        {
		return 3;
	}
}
class Main() 
{
   public static void main(String[] args)
   {
	Shape shape = new Shape();
	Square square = new Square();
    	Rectangle rect = new Rectangle();
	rect = (Rectangle)shape;
	System.out.println(square.area());
   }
}

Select an option to see the answer and solution.

What will be the output of the following Java code?
public class Shape 
{
	public int area()
        {
		return 1;
	}
}
public class Square extends Shape 
{
	public int area()
        {
		return 2;
	}
}
public class Rectangle extends Shape 
{
	public int area()
        {
		return 3;
	}
}
class Main() 
{
      public static void main(String[] args)
      {
	 Shape shape = new Shape();
	 Square square = new Square();
   	 Rectangle rect = new Rectangle();
	 rect = (Rectangle)square;
	 System.out.println(square.area());
      }
}

Select an option to see the answer and solution.

What will be the output of the following Java code?
public class Shape 
{
	public int area()
        {
		return 1;
	}
}
public class Square extends Shape 
{
	public int area()
        {
		return 2;
	}
}
public class Rectangle extends Shape 
{
	public int area()
        {
		return 3;
	}
}
class Main() 
{
       public static void main(String[] args)
       {
	 Shape shape = new Shape();
	 Square square = new Square();
   	 Rectangle rect = new Rectangle();
	 rect = (Rectangle)square;
	 System.out.println(square.area());
	}
}

Select an option to see the answer and solution.

What will be the output of the following Java code?
public class Shape 
{
	public int area()
        {
		return 1;
	}
}
public class Square extends Shape 
{
	public int area()
        {
		return 2;
	}
}
public class Rectangle extends Shape 
{
	public int area()
        {
		return 3;
	}
}
public static void main(String[] args)
{
	 Shape shape = new Square();
   	 shape = new Rectangle();
	 System.out.println(shape.area());
}

Select an option to see the answer and solution.

What will be the output of the following Java code?
public class Shape 
{
	public int area()
        {
		return 1;
	}
}
public class Square extends Shape 
{
	public int area()
        {
		return 2;
	}
}
public class Rectangle extends Shape 
{
	public int area()
        {
		return 3;
	}
}
public static void main(String[] args)
{
	 Shape square = new Square();
   	 Shape rect = new Rectangle();
     	 square = rect;
	 System.out.println(square.area());
}

Select an option to see the answer and solution.