Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what should i need to do..

 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


why s displays JAVA is displyed ?




but here x is not displaying JAVA
what to do for displaying JAVA here should i need to change the state of this object?
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15437
41
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Are you really surprised that this prints "JAVA"?

What's XYZ? Is it your own class? If you want this to print "JAVA", then you should implement your own toString() method in class XYZ.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic