Reputation: 2140
Ok, forget it. Just realized I forgot the brackets.
Good lord. I need a rest.
I'm designing my own double linked list.
public class DoubleLinkedList {
public DoubleLinkedList {
}
}
That's the extent of my code so far. Eclipse is underlining the public
in the constructor and telling me:
"Syntax error on token "public"
, class expected after this token"
It's a constructor, why is this happening?
Upvotes: 0
Views: 59
Reputation: 12042
Constructor must have the parenthesis ()
.
Do like this:
public class DoubleLinkedList {
public DoubleLinkedList() {
}
}
Upvotes: 2
Reputation: 178303
You missed the ()
on your constructor. Try
public DoubleLinkedList() {
}
Otherwise it's either a bad class definition or a bad variable definition, and Eclipse must have assumed the former.
Upvotes: 1