"Getting Started with Java" Hello World

Source: Internet
Author: User
Tags function prototype

1, the development of Java Program 3 steps: Edit, compile, run.

Edit: stored as text, suffix. java;

Compile: Generate an executable. class file;

Javac  Programname.java

Run: Terminal window input

Java  programname

2. Error message: Compile error, run-time error, logic error.

3. Command line Parameters

The program can accept command-line arguments, the first command-line argument is args[0], the second is args[1], ...

Java and C language, counting starting from 0;

In C language, the number of command line arguments argc, command line parameters argv;

The function prototype is

int Main (intchar *argv);

4. For loop in Java is different from C language

The C language needs to define variables (if needed) at the beginning of the code block that the curly braces mark, and the Java language is not limited by this.

 for (int i = 0; i < num; i++) // Java

5, System.out.print () and System.out.println () difference: the latter after printing the line.

"Getting Started with Java" Hello World

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.