This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Identifier expected Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Identifier expected" Watch "Identifier expected" New topic
Author

Identifier expected

Chris Rothgeb
Greenhorn

Joined: Mar 15, 2008
Posts: 11
Let me ask first. In this code is it necessary to have a test class or will it allow the user to input information and then display once the identifier issue is resolved.

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32689
    
    4
What is the actual question? Where do you get "identifier required," and what do you think it means?
Does the code even compile? I don't think it will since I can see code after a "return".
You are confusing the constructor with a method of the same name; avoid methods which might be confused with constructors.

I think it will probably run once you have got your compiler errors sorted out.
Chris Rothgeb
Greenhorn

Joined: Mar 15, 2008
Posts: 11
Apologies. I am confusing the constructor and method with same name. Ok. Thanks. I will redo it.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32689
    
    4
Good luck with it.

And you may find the "identifier required" is because you are declaring parameters without giving them a type.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Identifier expected
 
Similar Threads
Problem with looping... Arg
Code problems
Nested while loop inside do...while loop?
Setter/Getter method issues
Java noob -- sentinel-controlled while loop