Here is an example of this error:
public class SemicolonExpected
{
public static void main(String args[])
{
int x=10,y=10 //no ; (semicolon) is given after this statement
if(x==y)
System.out.println(x +" and "+y+" is equal");
}
}
Here no ; (semicolon) is given after the x,y declaration statement. The correct code is:
public class SemicolonExpectedSolution
{
public static void main(String args[])
{
int x=10,y=10; //; (semicolon) is given now
if(x==y)
System.out.println(x +" and "+y+" is equal");
}
}
0 comments:
Post a Comment