Results 1 to 2 of 2
  1. #1
    bboyinmartin is offline Member
    Join Date
    Jul 2013
    Posts
    18
    Rep Power
    0

    Angry Questions! Please help me D:

    package javaapplication2;
    class DayCounter{
    public static void main(String[] arguments){
    int yearIn = 2013;
    int monthIn = 12;

    if (arguments.length < 0)
    monthIn = Integer.parseInt(arguments[0]);
    if( arguments.length < 1)
    yearIn = Integer.parseInt(arguments[1]);
    System.out.println( monthIn + "/" + yearIn + " has "
    + countDays(monthIn, yearIn) + "days.");

    }


    This is just a part of the whole java file/program that I don't understand.
    So my question is, what length are they referring to at:
    if (arguments.length < 0)
    if (arguments.length < 1) ?

    Why did the person choose 0 and 1?


    Also, what is "Integer.parseInt" and does (arguments[0] ) mean the monthIn will be stored in the "String[] arguments"?
    If so, then what's the point of that?

    monthIn = Integer.parseInt(arguments[0]);
    yearIn = Integer.parseInt(arguments[1]);



    I know that I have many questions, but please answer this question too:

    When I type in statements and expressions in the main method, do they get stored inside the main method? (In the "String[] arguments" in this case)

    Please answer my questions
    I'm self-studying Java with a book that doesn't explain things very well.
    Thanks!

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,197
    Rep Power
    19

    Default Re: Questions! Please help me D:

    I have already asked you to go through the forum rules.
    Just few questions!

    I'm closing this thread. You may start another thread with a subject line that conforms to the rules.

    db

    THREAD CLOSED
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Questions about app
    By newProgrammer in forum Android
    Replies: 0
    Last Post: 10-16-2012, 05:42 PM
  2. Ok I have a few questions.
    By brocksoffice in forum New To Java
    Replies: 5
    Last Post: 07-29-2012, 02:47 AM
  3. Questions
    By Csharks in forum New To Java
    Replies: 8
    Last Post: 01-19-2011, 04:11 AM
  4. Questions About JSP?
    By mtz1406 in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 08-19-2008, 07:56 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
  •