Search:

Type: Posts; User: Rohan R

Search: Search took 0.13 seconds.

  1. [SOLVED] Re: I have a question related to instanceof operator

    Hi Aussiemcgr,

    System.out.println() CAN take boolean and that is not the issue.

    we can always declare and print boolean values

    boolean b = true;
    System.out.println(b); //output is true
  2. [SOLVED] Re: I have a question related to instanceof operator

    Hi Greg,

    I got the below information from SCJP Kathie Sierra:

    You can't use the instanceof operator to test across two different class hierarchies.
    Below code will NOT compile.

    class Cat{}...
  3. [SOLVED] I have a question related to instanceof operator

    Hi All,

    As per my knowledge, the instanceof operator compiles only if the reference type compared to class type are in the same inheritance tree.
    According to that, below code should not compile...
Results 1 to 3 of 3