error in main method

Discussion in 'Java' started by akash walia, Feb 23, 2012.

  1. akash walia

    akash walia

    Joined:
    Feb 23, 2012
    Messages:
    1
    why any variable that is intilised in main method in java doesnot print anything.infact it is given error..like


    class r
    {
    public static void main(string a[])

    {
    int r;
    system.out.println("r"+r); //error
    }
    }
    akash walia, Feb 23, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John M
    Replies:
    1
    Views:
    1,117
    Kumar Reddi
    May 29, 2005
  2. Hal Styli
    Replies:
    14
    Views:
    1,615
    Old Wolf
    Jan 20, 2004
  3. Frederick Ding

    int main() or int main(void)?

    Frederick Ding, Dec 3, 2005, in forum: C Programming
    Replies:
    10
    Views:
    641
  4. Ravi
    Replies:
    17
    Views:
    914
    Kenneth Brody
    Apr 1, 2006
  5. rahulsinner@gmail.com

    main() called inside main()

    rahulsinner@gmail.com, May 4, 2006, in forum: C Programming
    Replies:
    14
    Views:
    1,410
    Richard Heathfield
    May 7, 2006
Loading...

Share This Page