Im a newb still studying java programming
wats wrong with my scripts help..?
public class Sample1
{
public static void main (String[] args)
{
String desc;
if (mark >= 85)
desc = "Very Good";
else
if (mark >= 70)
desc= "Good";
else
if (mark >= 50)
desc= "Adequate";
else
desc = "Poor";
System.out.println ("Description=" +desc);
}
}
The error ->
Sample1.java:6: cannot find symbol
symbol : variable Mark
location: class Sample1
if (Mark >= 85)
^
Sample1.java:9: cannot find symbol
symbol : variable Mark
location: class Sample1
if (Mark >= 70)
^
Sample1.java:12: cannot find symbol
symbol : variable Mark
location: class Sample1
if (Mark >= 50)
^
3 errors
btw im using JGrasp software..=) help pls...
Patricia Shanahan - 13 May 2007 14:23 GMT
> Im a newb still studying java programming
> wats wrong with my scripts help..?
[quoted text clipped - 38 lines]
>
> btw im using JGrasp software..=) help pls...
The error messages do not appear to be from the posted software. In
Java, identifier capitalization is significant. "Mark" and "mark" are
different identifiers.
In the code as posted, there is no declaration for "mark". You need to
think through where it is going to come from to decide how to declare
and initialize it.
Patricia