aspose file tools*
The moose likes Beginning Java and the fly likes System or system? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "System or system?" Watch "System or system?" New topic
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: 39436
    
  28
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
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14272
    
  21

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 8 API documentation
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4422
    
    8

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.
 
Don't get me started about those stupid light bulbs.
 
subject: System or system?