WinkyCode's Profile User Rating: -----

Reputation: 9 Worker
Group:
Members w/DIC++
Active Posts:
157 (0.09 per day)
Joined:
23-February 11
Profile Views:
4,595
Last Active:
User is offline Jan 04 2014 06:41 AM
Currently:
Offline

Previous Fields

Country:
SE
OS Preference:
Linux
Favorite Browser:
Chrome
Favorite Processor:
Intel
Favorite Gaming Platform:
PC
Your Car:
Volkswagen
Dream Kudos:
0

Latest Visitors

Icon   WinkyCode thinking about status...

Posts I've Made

  1. In Topic: Args or arguments, is it any difference?

    Posted 18 Oct 2013

    View PostRyano121, on 17 October 2013 - 09:31 PM, said:

    Remember that the main method is really no different to any other method in base thinking. As long as the method signature is public static void main(String[]) (which it is regardless of what you name the variable) the compiler won't care at all.

    Defining main is no different to defining any other method. The only special thing about main is it becomes the method that the compiler looks at to define the entry point for your program. It's just like any other method where you can name you parameters anything you want (although remember that variable names should be as descriptive as possible).


    Thank you. Yes, now I have tried with different variation after the ...String[].... Here is an simple example
    public class Hello_56 {
    public static void main(String[] potato)
    {
    System.out.print("\nHello\n");
    }
    }
    


    As a n00b, I bow and thanking the seniors in this area. Thank you so much!

    As far as solution goes, look at this
    ...
    public static void main(String[] anyThingGoes){
    }...
    
    

    You can in theory use any name after the String[] as long as is not a keyword. But the accepted practice is to use args.

    :scooter:
    WinkyCode
    Riding for knowledge
  2. In Topic: Args or arguments, is it any difference?

    Posted 18 Oct 2013

    View Postandrewsw, on 17 October 2013 - 09:21 PM, said:

    You can call it args, arguments.. or potatoes. It is the name given to the String array that contains the command-line arguments that main() is automatically supplied with. Call it args though: there is no reason to break with an accepted practice.


    Ah, thank you. Now I understand it a bit better. Some books I have read on my native tongue started to change it back and forth and I did not understand why. Now I understand and one question mark is away. Big thank you!

    View Postmodi123_1, on 17 October 2013 - 09:22 PM, said:

    If I remember right - they are just command line arguments.. so you can name that variable what every ou like.

    http://docs.oracle.c...mdLineArgs.html


    Thank you. Also, thank you for the link. It gave some good information. :)

My Information

Member Title:
D.I.C Head
Age:
27 years old
Birthday:
June 15, 1988
Gender:
Location:
Sweden, Nacka
Interests:
Books about programming, learning programming Java, JavaScript, HTML and looking into C# (any diff between C, C++ and C# anyone?)
Full Name:
Leopold H Birkholm
Programming Languages:
Java, C#

Contact Information

E-mail:
Click here to e-mail me
Website URL:
Website URL  http://leopoldbirkholm.blogspot.com/
Yahoo:
Yahoo  leopoldbirkholm@yahoo.se
Skype:
Skype  leopold.birkholm

Friends

WinkyCode hasn't added any friends yet.

Comments

WinkyCode has no profile comments yet. Why not say hello?