This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Identifier expected, (already searched and read about this, still confused Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Identifier expected, (already searched and read about this, still confused" Watch "Identifier expected, (already searched and read about this, still confused" New topic
Author

Identifier expected, (already searched and read about this, still confused

jim gemlo
Greenhorn

Joined: Feb 24, 2004
Posts: 20
Here is my class:

getting identifier expected at the 'Class.forName'line.

This same piece of code works fine when I have it in a jsp page. Im trying to place this code in a Bean so I can remove business logic from my page. So I created this class and get the error.
thanks
Jeffrey Hunter
Ranch Hand

Joined: Apr 16, 2004
Posts: 305
You need to wrap your expressions inside a method. Right now, you have your variables declared correctly as instance variables, but you cannot have those expressions in the class scope. For instance, the following Class, though useless, represents the proper structure:

[ July 02, 2004: Message edited by: Jeffrey Hunter ]
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Identifier expected, (already searched and read about this, still confused
 
Similar Threads
bean in or out scope?
storing the Unicodes in the database
Chained combobox fails to work
How to store value in hidden field with struts 2.0?
problem---how to display ArrayList of ArrayList in jsp page.