This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Getting MEAN with Mongo, Express, Angular, and Node and have Simon Holmes on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Getting error in this code??? why is that so? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Getting error in this code??? why is that so?" Watch "Getting error in this code??? why is that so?" New topic
Author

Getting error in this code??? why is that so?

Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1066



http://www.lifesbizzare.blogspot.com || OCJP:81%
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14741
    
  25

Are we supposed to guess what the error is? Please TellTheDetails.

Looking at your code , line 7 is invalid. You can't put arbitrary statements at class level, only variable declarations with an optional initialization value.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Pratik D mehta
Ranch Hand

Joined: Jul 29, 2010
Posts: 121


I think you wan to do this


Understanding is Everything - Peter Lord
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Getting error in this code??? why is that so?