Initial knowledge of Java (for Beginners to Java and android)

Source: Internet
Author: User
<span id="Label3"></p><p><p>---written before the Blog.</p></p><p><p>Bo Master one hand dozen words, we have the wrong place can point out oh! And then the cheek for warmth! Hey</p></p><p><p>After so many years of development, slowly people are comfortable, want to do something meaningful, may be because I am a sensitive person, Bo master is not a computer professional background, halfway decent, rely on their own daytime the Night and night struggle, also is stepping into the software industry this door, sometimes back to think about, Just learn software that will be really not easy, so, decided to help beginners, the great god do not squirt me, I see the current efforts to delve into the beginner, as if to see the same year's own, so want to our own small, thought some confusion, we forgive oh, ok, now start the subject!</p></p><p><p>---what is a program?</p></p><p><p>Official: computers in some order to complete a series of instructions, this set of instructions is called the program;</p></p><p><p>Note: in principle, The program is executed from the top to the next step, it is irreversible (except for the loop), so you found in the debug when the breakpoint can not be returned, ah haha!</p></p><p><p>What about the program? Like when we go to the girls, we have to get this Chick's information to decide whether it's a bubble or not? And then we have to get the contact information to start the Bubble. And then you have to get out of the way to eat and have a chance, right? The last Ruanmoyingpao to get it? This step together is the program, do not know that I say that people understand? (note: Bo Master also once killed matt, haha!) )</p></p><p><p></p></p><p><p>Why Do---learn java?</p></p><p><p>This everybody understands, the market demand is high, the salary is also high, is not? Hey</p></p><p><p></p></p><p><p>---development of the first Java program?</p></p><p><p>Development environment Here The blogger is no longer speaking Oh.</p></p><p><p>Open eclipse, left-click file,new,javaproject, enter project name, complete, right key project, new one package, right-pack new one class, enter HelloWorld to finish now look at the Project:</p></p><p><p></p></p><p><p>---JAVA Program Structure</p></p><p><p>1. Programming Framework</p></p><p><p>public class helloworld{}</p></p><p><p><strong><span style="background-color: #800000;">where HelloWorld is the class name, he wants to be the same as the Program's file name</span></strong> , as to what is a class? will be in-depth study in future blogs. The class name is preceded by the public (common) and class (class) two keyword decoration, their order can not be changed, the middle of the space is separated by a number. The class name is followed by a pair of curly braces, and the business logic is inside the curly Braces.</p></p><p><p>2. Main () method</p></p><p><p>public static void main (string[] Args) {}</p></p><p><p>What does main do?</p></p><p><p>What people do is always started again, is to (have the ability to give an example of not starting to scare Bloggers. --! ), This is called the starting point, that is, the <span style="font-size: 15px;"><strong><span style="background-color: #800000;">Main method is the starting point of a program, any program starts to run from the main function starts</span></strong></span> , since this, do things, we can not have a few starting point, <span style="background-color: #800000; font-size: 15px;"><strong>then the program has only a starting point, In other words, a program has only one main method</strong></span> , do not know that you can accept it? In development, the main function is also called the entry function, the main function and so on ...</p></p><p><p>3. Write code</p></p><p><p>System.out.println ("hello!"); and System.out.print ("hello!"); What difference does it have?</p></p><p><p>Plus "ln" means a newline, that is, the next sentence output at the beginning of the second line, do not add is not wrapped, you want to output the content in () Inside. Then run the project and you'll see the output in the Console.</p></p><p><p>Java annotations</p></p><p><p>1. Single-line Comment</p></p><p><p>is to say the content is less used, usually put on the code line with "//" beginning, followed by the description</p></p><p><p>2. multi-line annotations</p></p><p><p>To describe a lot of content, put in the code to explain the line, use/**/,/* here to write comments * *.</p></p><p><p>well, It's here today, See you next time! -^-!</p></p><p><p>Initial knowledge of Java (for Beginners to Java and android)</p></p></span>

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.