wood burning stoves
The moose likes Beginning Java and the fly likes Compile issue -- misplaced construct error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Compile issue -- misplaced construct error" Watch "Compile issue -- misplaced construct error" New topic

Compile issue -- misplaced construct error

Vraj Desai

Joined: Jan 28, 2012
Posts: 1
hi im using ready to program and after writing this code into the program i get a misplaced construct error.

please help i dont know what i did wrong.

the exact error : misplaced construct(s)

it highlights this line
import java.awt.*; 2nd line

at the very start and gives me the misplaced construct error

Yes this is all the code i have written down.

[Edit - added code tags - see UseCodeTags]
Matthew Brown

Joined: Apr 06, 2010
Posts: 4543

Hi Vraj. Welcome to The Ranch!

The compiler should tell you what line the error is occurring on. That should give you a good clue as to what's gone wrong, but if it's not enough can you tell us what line it is?
Henry Wong

Joined: Sep 28, 2004
Posts: 20535

[EDIT -- changed the subject title to something more informative than "Helppp !!".]

Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Praveen Kumar M K
Ranch Hand

Joined: Jul 03, 2011
Posts: 256
Do you have all the code that you've posted here, in one file?
I agree. Here's the link: http://aspose.com/file-tools
subject: Compile issue -- misplaced construct error
It's not a secret anymore!