![]() |
Snytax error
good evening (it is 7:53 pm in the place where i live in)
i was writing programme for project and then i snytax error for integers and string and java suggested to import java.lang.String and int i used ( ; ) and it was working prefectly, this was yesterday.... today morning i had snytax error this package, so where is the problem? the error says (';' expected) but the semi-colon is there... so where is the error? |
Re: Snytax error
Post the code, you may find that you missed a ';' on the previous line or the statement you have on one line is not quite correct and so it expects a ';' to mark then end of a statement.
But post you're sections of code where you having prblems with a few lines either side. Chris |
Re: Snytax error
:
import javax.swing.*;in importing java.lang i got snytax error ( expected ; ) |
Re: Snytax error
it expects a ';' after String, so you would have to place int on a dif import statement. Although am i not right in saying that Java automatically imports the whole java.lang package anyway. Its the only which it does.
Chris |
Re: Snytax error
As Freaky Chris noted, java.lang.* (which includes String) is automatically imported by the JVM. You do not need to import basic types such as int as they are built into the language.
|
Re: Snytax error
but i won't import it if i didn't find error which was about importing the package
|
Re: Snytax error
What exactly is the error you get when you don't import the package?
|
Re: Snytax error
the programme asking for semi-colon but it is there
|
Re: Snytax error
No i mean, what error do you get without trying to put the
import java.lang.String and int statement in. AS in what was the error that made you try to include these? |
Re: Snytax error
i asked to help from one of my classmate and here is the code
this for the clas which has the operations :
public class Convert{ // Convert class startsand this for main method :
//import java.lang.String and int; the last error disspeared but i have error in last brea which is this : :
String Option0=JOptionPane.showInputDialog("Enter Number to Exit from The Programme");do you have any idea about this error and how could it be solved?? |
| All times are GMT -5. The time now is 9:30 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC