Why do my outputs produce nothing but false? — oracle-tech

    Forum Stats

  • 3,715,723 Users
  • 2,242,844 Discussions
  • 7,845,508 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Why do my outputs produce nothing but false?

Sergio1234
Sergio1234 Member Posts: 33
edited September 2017 in Java Desktop Applications

/////////////////////////////////////////////////////

package Test;

class Outer

{

private Inner variable = new Inner();

class Inner

{

Inner()

{}

}

Outer()

{}

Inner getInner()

{

return variable;

}   

}

/////////////////////////////////////////////////////

package Test;

import static java.lang.System.*;

public class Test {

  

    public static void main(String ...args)

    {

       Outer outer = new Outer();

       

       Outer.Inner inner = outer.getInner();

      

       out.println(outer.getClass().isAnonymousClass());

      

       out.println(outer.getClass().isSynthetic());

      

       out.println(inner.getClass().isAnonymousClass());

      

       out.println(inner.getClass().isSynthetic());

      

       out.println(Outer.class.isAnonymousClass());

      

       out.println(Outer.Inner.class.isAnonymousClass());

      

       out.println(Outer.class.isSynthetic());

      

       out.println(Outer.Inner.class.isSynthetic());

    }

}

/////////////////////////////////////////////////////

Answers

This discussion has been closed.