File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Object Arrays

 
Joel Christophel
Ranch Hand
Posts: 249
1
Chrome Eclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator




The printout is:
0
0

Why is this? Didn't I just set both radii to 50? It acts like it's ignoring the method calls from class Circle.
 
Matthew Brown
Bartender
Posts: 4549
8
Java Netbeans IDE Scala
  • 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a closer look at your Circle.setRadius method. It isn't doing what you think it's doing.
 
Joel Christophel
Ranch Hand
Posts: 249
1
Chrome Eclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks once again
 
Ove Lindström
Ranch Hand
Posts: 326
Android Firefox Browser Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Matthew Brown wrote:Have a closer look at your Circle.setRadius method. It isn't doing what you think it's doing.


Classic... I once spent 3 days trying to find one of those errors. ;)
 
John Jai
Rancher
Posts: 1776
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ove Lindström wrote:Classic... I once spent 3 days trying to find one of those errors. ;)

Yes... given that compiler also don't warn on such situations.
 
Ove Lindström
Ranch Hand
Posts: 326
Android Firefox Browser Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John Jai wrote:
Ove Lindström wrote:Classic... I once spent 3 days trying to find one of those errors. ;)

Yes... given that compiler also don't warn on such situations.


Exactly. But both PMD and FindBugs detects it so they are used in most of my continuous integration environments nowadays.
 
ali Dada
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you are declaring:

but you are assigning in setRadius as


By default the variable which is integer is 0; so it displays 0;
write as:

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic