This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes What is wrong with this code? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Beginning Java
Bookmark "What is wrong with this code?" Watch "What is wrong with this code?" New topic

What is wrong with this code?

Mrah Mrah

Joined: Nov 27, 2005
Posts: 1

It keeps saying <identifier> expected on the Dice1.roll(); and the next 2 lines

ARGHH. Im new to java and i dont understand what im doing wrong

[ November 27, 2005: Message edited by: Mrah Mrah ]
[ November 27, 2005: Message edited by: Mrah Mrah ]
Svend Rost
Ranch Hand

Joined: Oct 23, 2002
Posts: 904

and welcome to the JavaRanch. Let me see if I can give you a few pointers,
so you can continue your school project/assignment.

Before I can help you, I need you to clarify the following:
Why did you locate the method calls where you did? in the class P4_4


Please explain the "public interface" of the Die class (i.e. it's public
methods). Btw. according to the "Java naming convention" we name references
or variables with a lowercase character as the first character (e.g.
Person svend = new Person())


What's die1 and die2?


Please take an extra look at the lefthand side of this assignment.

Happy coding.

/Svend Rost
Chad Clites
Ranch Hand

Joined: Aug 16, 2005
Posts: 134
Not to mention it is not nice to post the same question at multiple forums..

I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: What is wrong with this code?
It's not a secret anymore!