Results 1 to 3 of 3
Like Tree1Likes
  • 1 Post By j2me64

Thread: idiot question, I know but I am a total beginnner, please forgive me.

  1. #1
    Join Date
    Jan 2012
    Posts
    7
    Rep Power
    0

    Default idiot question, I know but I am a total beginnner, please forgive me.

    I am new to java and this site, so first thanks for reading this.

    I am trying to learn java and I have a book called thinking in java, it seems to be a good book.

    There is a line of code that just confuses me a bit and I would like some clearification about it.

    int storage(string s)
    return s.length() * 2;

    This is total beginner stuff I know.
    the very first part is what confuses me, why is storage there? int initializes an intiger, (string s) is makeing a string called s, and return s.length() returns the lenght in bytes of s.

    I just dont know why the word storage is there.

    Any help is appreciated

    Thanks

  2. #2
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    5

  3. #3
    Join Date
    Jan 2012
    Posts
    7
    Rep Power
    0

    Default Re: idiot question, I know but I am a total beginnner, please forgive me.

    ok thanks so lets see if I got it this time...

    so int is the reurntype storage is the method(string s) is the argument.

    The method names and class names he uses in this book connfuse me sometimes.

    thanks for the link
    walkswithzombies

Similar Threads

  1. (Me <= idiot)?
    By truant420 in forum AWT / Swing
    Replies: 8
    Last Post: 03-11-2011, 05:31 PM
  2. Calculating Total?
    By ethemartian in forum New To Java
    Replies: 6
    Last Post: 02-21-2011, 04:09 AM
  3. Java idiot...help!!!
    By usa100 in forum New To Java
    Replies: 2
    Last Post: 01-05-2011, 02:49 PM
  4. Printing total out
    By denisdoherty in forum New To Java
    Replies: 1
    Last Post: 04-25-2008, 06:40 AM
  5. Am I an IDIOT ?????????????
    By Mandilon in forum New To Java
    Replies: 1
    Last Post: 02-02-2008, 08:56 AM

Posting Permissions

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