Error in code: <identifier>expected & return type required

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • poojarautela01
    New Member
    • Jan 2013
    • 1

    Error in code: <identifier>expected & return type required

    Code:
    public class greatest
    {
    	public Static void main (String args[])
    	{
    		int a,b,c;
    		a=10;
    		b=20;
    		c=15;
    		if(a>b&&b>c)
    		{
    		System.out.println("a is greatest number");
    		}
    		else if(b>a&&b>c)
    		{
    		System.out.println("b is greatest number");
    		}
    		else
    		{
    		System.out.println("c is greatest number");
    		}
    	}
    }
    Last edited by Rabbit; Jan 13 '13, 11:28 PM. Reason: Please use code tags when posting code.
  • Anas Mosaad
    New Member
    • Jan 2013
    • 185

    #2
    Statis should be small letters (i.e. static)
    Code:
        public [B]static[/B] void main (String args[])

    Comment

    • Anas Mosaad
      New Member
      • Jan 2013
      • 185

      #3
      Please try to use an IDE with syntax highlighting like eclipse. It will greatly help you saving much time resolving such issues.

      Comment

      Working...