File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

Compile issue -- misplaced construct error

Vraj Desai
Greenhorn

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
Bartender

Joined: Apr 06, 2010
Posts: 4363
    
    8

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
author
Sheriff

Joined: Sep 28, 2004
Posts: 18717
    
  40

[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?
 
 
subject: Compile issue -- misplaced construct error