| Author |
System or system?
|
hamza mohamed ansari
Greenhorn
Joined: Nov 09, 2012
Posts: 2
|
|
still i,m having the same error package system does not exist ,even i changed System instead of system/.
error ^ is pointing out the( . )dot
my code
public class loopy
{
public static void main(string[] args)
{
int x=1;
System.out.println("before the loop");
while(x<4)
{
System.out.println("in the loop");
x=x+1;
}
System.out.println("this is after loop");
}
}
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32611
|
|
Welcome to the Ranch
Please do not add new questions to an old thread. Fortunately I can create a new thread from your post.
Please copy‑and‑paste all code and errors. I ran your code and did not get the error you quoted. You did however manage to write string instead of String.
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12907
|
|
Java is case-sensitive. That means that "System" is not the same as "system", and "String" is not the same as "string". You have to get the spelling exactly right; if the name of a class has a capital letter, then you must write it exactly like that.
You write:
Class String is with a capital S. So that should be:
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
Matthew Brown
Bartender
Joined: Apr 06, 2010
Posts: 3786
|
|
|
It's also easier to get used to the conventions if you use them yourself. Following standard Java conventions classes always start with a capital (like String and System), and variables and methods with a lower-case letter. So while it makes no difference to whether it works or not, Loopy is a better class name than loopy.
|
 |
 |
|
|
subject: System or system?
|
|
|