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

    Forum Stats

  • 3,702,040 Users
  • 2,239,552 Discussions
  • 7,835,730 Comments

Discussions

Why do my outputs produce nothing but false?

Sergio1234Sergio1234 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.