Solved

Class Vehicle {}

Question 69

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

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents