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
    Likes Received:
    0
    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. Advertisements

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,634
    Kumar Reddi
    May 29, 2005
  2. Hal Styli
    Replies:
    14
    Views:
    2,061
    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:
    884
  4. Ravi
    Replies:
    17
    Views:
    1,173
    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,742
    Richard Heathfield
    May 7, 2006
  6. Army1987

    int main(void) { return main(); }

    Army1987, Mar 29, 2007, in forum: C Programming
    Replies:
    37
    Views:
    1,756
    Daniel Rudy
    Apr 3, 2007
  7. ravi
    Replies:
    28
    Views:
    1,313
    Richard Heathfield
    Sep 26, 2007
  8. x_knifer_x@hotmail.com

    int main(void) is better than int main()

    x_knifer_x@hotmail.com, Jan 2, 2008, in forum: C++
    Replies:
    55
    Views:
    1,729
    Lionel B
    Jan 16, 2008
Loading...