Search:

Type: Posts; User: helloworld922

Search: Search took 0.10 seconds.

  1. Re: Question regarding superclasses & subclasses

    Student is a Person, but a Person is not necessarily a Student. A Person could be a Teacher, Staff, etc.

    In general there's no way for the compiler to know before-hand if a Person variable does...
  2. Re: Question regarding superclasses & subclasses

    student2 is a variable of type Person, which holds a Student object which happens to also be a Person (due to polymorphism).

    You can check this quite handily using the instanceof method:

    ...
Results 1 to 2 of 2