aspose file tools*
The moose likes Associate Certification (OCAJP 7) 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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Associate Certification (OCAJP 7)
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: 4908
    
  10

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: 4908
    
  10

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
 
Similar Threads
Implicit Import is not working - import planets.*; not working.........
Java lang error
<indentifier> expected
Probable error on 1-3 exercise on OCA Java SE 7 Programmer I Study Guide (Robert Liguori)
Mouse shift event coding - to trigger a predetermined sequence of images to a GUI