What is the output of the following code where Student is a subclass of Person class? Person s = new Student(); if (s instanceof Student) { System.out.print("This is a student ”); } else {...



  1. What is the output of the following code where Student is a subclass of Person class?



Person s = new Student();


if (s instanceof Student) {


  System.out.print("This is a student ”);


}


else {


   System.out.print("This is a person ”);


}




  1. This is a student

  2. This is a person

  3. This is a student This is a person

  4. Syntax error



Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here