Page 2 of 2 FirstFirst 12
Results 21 to 26 of 26
Like Tree1Likes

Thread: main method String

  1. #21
    Join Date
    Sep 2011
    Location
    India
    Posts
    67
    Rep Power
    0

    Default Re: main method String

    will you plz tell me what is the initial capacity of String. how of the information was stored in a string?

  2. #22
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,902
    Rep Power
    25

    Default Re: main method String

    Its a waste of time worrying about it. It works and works every time.

    In some countries cars drive on the righthand and in some on the lefthand side of the road. That's the way it is.

  3. #23
    Join Date
    Sep 2011
    Location
    India
    Posts
    67
    Rep Power
    0

    Default Re: main method String

    ya right.. But my actual thinking is... why the java author said every java progrm runs from main... why it's run other methods?

  4. #24
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,902
    Rep Power
    25

  5. #25
    Join Date
    Sep 2011
    Location
    India
    Posts
    67
    Rep Power
    0

    Default Re: main method String

    thank you sir. and last and final qust.. what's the difference b/w string and string buffer...? dont say string is immutable and string buffer is mutable..
    if you try this prgram you found that string is mutable:
    class str{
    public static void main(String args[]){
    String s1="java";
    String s2="prg";
    s1=s1+s2;
    System.out.println(s1);
    }
    }
    o/p: java prg.
    If strings are immutable, why the java interprter gives javaprg is the output....?

  6. #26
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

    Default Re: main method String

    Don't ask the same question in more than one thread.
    String vs stingBuffer

    As you appear to have finished with the question you asked in this thread, I'm locking it.

    db

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Main Method
    By maya700 in forum New To Java
    Replies: 13
    Last Post: 07-23-2011, 09:41 AM
  2. main method
    By 007 in forum New To Java
    Replies: 18
    Last Post: 06-25-2011, 02:47 PM
  3. Running main method class from another main class
    By tlrocketman in forum New To Java
    Replies: 3
    Last Post: 12-06-2010, 09:30 AM
  4. Calling The main method from another method
    By SwissR in forum New To Java
    Replies: 3
    Last Post: 07-27-2010, 12:03 PM
  5. calling method from main method
    By bob_bee in forum New To Java
    Replies: 4
    Last Post: 10-02-2009, 06:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •