Solved

Class Vehicle {}

Question 60

Essay

class Vehicle {}
public class Car extends Vehicle
{
   public static void main(String args[])
   {
      Vehicle myCar = new Car();
      boolean result =  myCar instanceof Car;
      System.out.println(result);
   }
}
The above code uses the instanceof operator to determine whether an object is a member of a class. What will be the output following execution?

Correct Answer:

verifed

Verified

The instanceof will return tru...

View Answer

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions