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:
Verified
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q64: Create a class named Student that contains
Q65: What is the process of inlining and
Q66: You have a Student class with a
Q67: What is information hiding and how is
Q68: class InstanceofDemo
{
public static void main(String[]
Q70: How is the keyword protected used?
Q71: Using a class named Student , write
Q72: What are virtual method calls?
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents