ExamVeda
Login
Home
71
What does Liskov substitution principle specify?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
72
What will be the correct option of the following Java code snippet?
interface ICust 
{
}
class RegularCustomer implements ICust 
{
}
class OneTimeCustomer implements ICust 
{
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
73
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());
    }
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
74
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());
   }
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
75
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());
   }
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
76
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());
   }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
77
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());
      }
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
78
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());
	}
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
79
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());
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
80
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());
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board