• Post Reply Bookmark Topic Watch Topic
  • New Topic

static modifier  RSS feed

 
MaheshS Kumbhar
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


In above code sample, I am getting an error "class or interfac type required" pointing at method definition.
What is the cause?
 
Pradeep Kumar
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess your code should be something like this.

 
Rob Spoor
Sheriff
Posts: 21133
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pradeep is right. The return type must come immediately before the method name. Any modifiers (static, synchronized, access modifiers like public, etc) must come before the return type but are allowed in any order.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!