aspose file tools
The moose likes Java in General and the fly likes A return int method problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "A return int method problem" Watch "A return int method problem" New topic
Author

A return int method problem

Andrew Parker
Ranch Hand

Joined: Nov 12, 2001
Posts: 178
Hi,
Here is the code:

It throws Exception when I make it. Why yo.getSize() cannot return an int?
Any idea?
Thanks
Andrew Parker
Ranch Hand

Joined: Nov 12, 2001
Posts: 178
sorry, it should be public int CardsUndrawn()
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
What exception is thrown exactly? I don't see anything wrong off the top of my head. Also, which line throws the exception?
If you can give these details, then we can more easily help you find the solution to your problem.
Layne


Java API Documentation
The Java Tutorial
William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 965

Did you not post all the code?

What is "header"?
You constructor for LinkedListItr assumes that "theNode" is not null. Which in this case may be the case.
Than when you test in "isListEnd()" you once again are not testing to ensure that "current" is not null, which I think may be your problem.


Please ignore post, I have no idea what I am talking about.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: A return int method problem
 
Similar Threads
get fifth element from last for a Singly linked list
My LinkedList Iterator - Can't print first element - No use of Java API
cannot insert into linkedlist after delete
on calling methods..
How to insert an object to a linkedlist ADT?