The learning experience of Java

Source: Internet
Author: User
Tags abstract modifier modifiers

Java introduction of a lot of articles, but there is no one is the first macro introduction of Java, I work while learning Java about half a year, because the nature of the work is very different programming writing, learned so long or no results. may also be because there is no good teacher, walked a lot of detours, it is rare to have the time to summarize their learning experience, I hope other beginners can walk the "shortcut." Before studying, it is best to find a good editor, I choose JBuilder.

Java in general and languages such as C + +,. NET, Delphi are the same as the same ancestor, so people familiar with this type of programming are particularly easy to learn, they are object-oriented programming languages.

Learn any language (including English), the foundation must play well, not learn to walk running can not be fast. So learning Java must first Java's several basic elements to learn. Here is a summary of my learning sequence and considerations:

1, data type Java is a strongly typed language, the various types are not automatically converted, you must first define before use.

2, the method method is equivalent to define a "macro", a "function", the method is defined in the format:

The descriptor modifier Returns the value method name (parameter) {method body}. "

When learning a method, pay attention to the three things, "specifiers," "modifiers," "return values."

When we invoke the "method" in Java's self-contained "class", we do not have to begin to understand what is written in these methods (you can read the best, of course). All we need to know is that, after using this method, the "type" description of "return value"

3, class in Java most often hear words, but also the most troublesome thing, the definition of the class format is:

Specifiers class name extends Super Class name implements interface name {principal}

4, variable constants Java constant names are generally expressed in uppercase letters, and in order to conserve memory, generally defined as static (in Java program names we often have a default rule, class name all words first letter uppercase, method name second word start first letter uppercase, variable name lowercase, So we look at the program is very clear, the habit of forming good from childhood, hehe, the definition of the variable format is:

"Modifier data type variable name"

A variable is defined in the class (not part of the method body called a field) and is defined differently in the method body (definition does not need modifiers in the method body). When learning variables, pay attention to two special things such as "This" and "super". At the same time we will learn what is called "overlay", "overload."

5, control flow of all programming language control statements is nothing more than a few if else for the while do switch.

6, interface: An abstract thing, the interface can be more inherited, solve the class can only single inheritance problem. The interface is defined in the following format:

Specifiers Interface interface Name {principal},

Methods within an interface are all without principals, only constants or variables. When a class uses an interface, be sure to "overwrite" the method of the interface.

7, Thread: Thread is a relatively complex thing, such as a horse racing program has seven horse race, there are seven threads, it seems to be running at the same time, in fact, the computer is allocated a different time period to allow seven threads to run. Our beginner's program may not be used. ---www.bianceng.cn

So far, the basic concept of Java we have a certain understanding, we began to study the Java class. The Java Core APIs (that is, the classes that Sun has written for us) have the following. (There are many other extensions)

Java.lang java.io java.util java.net java.awt java.applet java.sql java.text

Each class has many methods, each object's type is different, the method that can use is different, we had better have a class library in hand, can consult at any time, if your English is good, can also go to Sun Company's website or use JBuilder's help document. No one can remember the use of so many classes at once, and not all classes are useful to our programs, and we certainly choose the classes we need to learn.

General procedures can not escape the string operation, file operations, database operations, so Java.lang java.io java.sql These several classes we have to see.

If you want to write applets applet (small program can be applied to the network, very useful.) May be the application of small programs the deepest image is some animation effect, in fact, the small program used in securities, games and other aspects of the effect of other network scripting can not be replaced. Then you need to learn Java.applet java.awt these two classes.

If you want to write some Web programs, you need to learn java.net.

If we're going to learn to write JSP, EJB, Servlet (JSP, and servlet in fact), we need to learn Java's graphical aspects of the class (java.awt). We can get started by learning string manipulation, file manipulation, database operations, and then learning java.net and how to write EJBs (more abstract and complex, similar to COM's concept).

Since this is just an introduction to the experience of learning Java, perhaps you can read this article even a Hello world cannot be made up, but if you could save a little time in a thick Java book, I would like to make a contribution. Hope you and quickly find the right things for yourself in Java (because Java is too powerful).

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.