aspose file tools*
The moose likes Associate Certification (OCAJP 7/8) and the fly likes Constructors Compile Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Associate Certification (OCAJP 7/8)
Bookmark "Constructors Compile Error" Watch "Constructors Compile Error" New topic
Author

Constructors Compile Error

Omar Jouda
Greenhorn

Joined: Jul 11, 2012
Posts: 19
Why Can't I create this constructor? What is going wrong?


Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5596
    
  15

Because your constructor has invalid syntax. Take a close look to your constructor and see if you can spot the problem.


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Omar Jouda
Greenhorn

Joined: Jul 11, 2012
Posts: 19
Roel De Nijs wrote:Because your constructor has invalid syntax. Take a close look to your constructor and see if you can spot the problem.

The parenthesis for empty parameters?
So it should be public Earth() { etc.. } .

I wrote it exactly as in a book of mine. Apparently it is wrong.

Thanks!
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5596
    
  15

Omar Jouda wrote:The parenthesis for empty parameters?
So it should be public Earth() { etc.. } .

Exactly!

Omar Jouda wrote:I wrote it exactly as in a book of mine. Apparently it is wrong.

You always have to be careful when copying from a book. Authors do a very good job trying to make the book free of mistakes, but it's very, very dificult process and unfortunately sometimes a mistake is not seen by the author and/or the technical review team. That's why most of the books have an errata section (in the book and/or online).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Constructors Compile Error