Stupid way to learn Java

Source: Internet
Author: User

This article assumes that the reader does not understand anything, or has to toss some language, such as C, but the beginner.

Classic case, HelloWorld start, learn a language in the understanding, I try to explain why to write, it is very likely that the designer is not designed according to this idea,

Java is an object-oriented language, in the object-oriented world, they classify a lot of things, for short, all things are objects. Okay, a keyword came out. Class (Class), which is plainly a collection, an element belonging to this class, (-set belongs to this set.)

This class can be familiar to the outside world, okay, communist victory, public shutdown word come, take hello for example, nature this class called Hello, the first line of public class Hello//Well this is the grammar of the language, that is, the order of words Way, that design language people so designed/We define a public class Hello, can print output HelloWorld,

Well, the printout, in the C world we write print ("Hello"); Yes, it does. The meaning of the printout hello, well, it's English, yes.

We have to talk about a paragraph before we have to open a head, end it, the language designer to the beginning and end of the design together, said the key in the inside main, what effect does main have, no effect is blank void, return to a vernacular, this method also has to be public, and this print and C Is it the same inside? Java programs run on virtual machines, right? That's what we have to tell our mainframe to do.

System, you output a string to call the system method systems. IO, Output System.out.println ("string")

Declares the return of this method, and the input, which is usually called a parameter, argument

public void Main (String [] args) {

System.out.println ("Hello")

}

Well, the whole program is like this,

Public  class Hello {public    static void Main (String []  args) {        System.out.println ("Hello");}    }

Tail: Or I Python fun, simple not wordy:

Print ("Hello")

Stupid way to learn Java

Related Article

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.