I just started JAVA. I have some programming experiences. I started reading and doing codes from "Headfirst JAVA" book. Rather than just reading the code I have been trying even the examples in the book and trying to compile them. But at this stage of my learning, I have very limited knowledge; especially when black command console shows me an error. I don't understand what type of error it's referring to. The book talks about API reference. But when I go in there, API seems to be some links between thousands of things with little explanation. Besides, when I look at API references, if I don't understand one or 2 links in that API, I don't even get the answer of what I was looking for in that API.
??)Is there any simpler way or any place I can find explanation of the error(s)?
For example: herebelow a small code I copied exactly from the book and wanted to compile it.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Public class loopy
{
public static void main( string[] args )
{
int x = 1;
System.out.println("Before the Loop");
while (x <4)
{
system.out.println("The value of x is" + x);
x = x + 1;
}
System.out.println("This is after the Loop");
}
}
>>>>>>>>>>>>>>>>>>>>>
after I typed javac loopy.java this was the error in console:
C:\>javac loopy.java
loopy.java:1: class, interface, or enum expected
Public class loopy
^
1 error
>>>>>>>>>>>>>>>>>>>>>>
Now my question is even if book's example doesn't compile, what might happen to the exercises at the end of all chapters?
Help me out reading the error from left to right...
loopy.java:1 class, interface, or enum expected what exactly is it looking for and where can I get the explanation on this?
You might be sensing little frustration in my writing, but it's nothing personal against you. Any type of help would be appreciated.