Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Syntax error on token

807606Mar 16 2007 — edited Mar 17 2007
Hi, I am new to Java. I am getting a compiler error I am not able to resolve the error. Can somebody Please meout? Below is the error that I am getting.

Syntax error on token "LinkedList", "interface", "class" expected.

Below is the code snippet on which I am getting this error.

public LinkedList getPolicyBaseRecordByPriorId(BigDecimal priorPolicyId) throws TFGSessionException {

Comments

569573
I think this is the first line of your program except package and import.
You should use public class XXX {} around your codes.
807606
To put it another way:

Your method definitions have to appear inside of classes. Unlike many other languages, Java does not allow for free-standing functions like that.
1 - 2
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 14 2007
Added on Mar 16 2007
2 comments
208 views