Advanced Java language Process

Source: Internet
Author: User
Tags thread stop xpath visualvm

"The following is definitely not a complete list, welcome to add"

Java is a common programming language, can actually do a lot of things, how to learn Java to see how to use.

But there are some general steps:

1. Familiar with a text editor, such as Vim, Emacs, notepad++, textmate, etc. Know which are open source, which are closed source, and which are charged. Develop the habit of not using pirated software.
2. Install the JDK (it is recommended to install OPENJDK with your Linux distribution's package Manager, which may need to read the release specific documentation)
3. Write a Java Hello World program, compile it with the command-line tool Javac, and then run the program with the Java command. The process is familiar with the source code, bytecode, virtual machine These things, and the Java Packages (package) affect the path where the. class file resides.
3.5. If both command-line tools are proficient, you can start choosing a favorite integrated development environment, such as Eclipse. Of course, develop the habit of not using pirated software. Be familiar with how to establish "engineering" and the use of shortcut keys.
4. Learn about Java's process-oriented programming, including basic data structures, expressions, statements, control flows, function calls.
5. Learn Java's object-oriented programming, including class, reference type and value type differences, members, methods, access control, inheritance, polymorphism, interface, interface implementation. By the way, learn the basic idea of object-oriented, that is, object, message, encapsulation, inheritance, polymorphism, etc., these common content is not Java-specific.
5.5 This should already involve Java garbage collection. Be aware of memory leaks that occur even with garbage collection (such as designing array containers yourself, elements are references, elements are logically removed, but not Qingcheng null).
6. Learn about Java exception handling, but it is more important to learn when to use special return values instead of exceptions, when to throw exceptions without handling exceptions, to know what Pokemon catch and its harms, and to understand why Java checked Exception is a bad feature. If you want, learn about Java1.7 's Try-with-resource statement and autocloseable interface at the same time.
7. Familiar with Java common data structure, such as basic array type, and generic container (java.util.*), especially java.util.list<t> interface and java.util.arraylist<t> implementation , and<t,u> interface and java.util.hashmap<t,u> implementations. (You don't have to touch the previous java1.5 without a generic parameter) also notice the difference between the basic type int, double, and the boxed type integer and double, and how they are automatically converted.
8. Familiar with the various tools in the Java standard library, including date time, string formatting, IO, etc. If you know that you want to close () the file yourself in the finally clause, or use Java1.7 's Try-with-resource, don't be paranoid that the garbage collector will turn off the file for you.
9. Learn about the naming habits of Java, and the general JavaBeans, and know why Getter/setter is better than directly manipulating member variables. In this way, the Java variables, methods named. Also see if your IDE can automatically generate getter and setter for you.
10. Use a third-party library (such as the Apache Commons Lang Common Tool Library) to have your program rely on its binary jar package (instead of copying the source code directly), compile and run with the command line (note classpath, etc.) And be familiar with how to add third-party dependencies with your integrated development environment. Feel the hassle of manually managing dependencies.
11. Learn about Maven's use, try to get Maven to help you with your dependencies, and try to get Maven to help you create an Eclipse project. Try Maven package release again.
12. Learn about software testing, how junit is used, and how junit is used in the IDE. Have time to look at coverage tools.
13. Read the "design pattern" written by Gang of four (this book is in C + + and Smalltalk languages, but it is still suitable for Java). Specifically this book, the library should be able to borrow the original English, Because I've borrowed it.

The next step is to look at the specific aspects of the application, to see the needs. For example (no order below)

"...." If you're not comfortable learning Java, learn python.
* If the concept of object-oriented programming is a bit unaccustomed, learn Smalltalk. (Ruby is OK, but not as Smalltalk Classic.) Ruby's documentation is a big mishap. )
* If Java is too verbose, learn Python
* If Java is too verbose, and you want to use the JVM, you have the energy to learn Scala
* If the relationship between objects is a bit dizzy, learn UML, and some of its diagrams, can be intuitive modeling of programs and operations. Your IDE may have plugins that can generate UML diagrams. But don't be too obsessed with these methodologies.

debugging and accessibility Learn about the debugging tools that your integrated development environment provides, and add breakpoints to try
* Try Jconsole or VISUALVM to monitor the status of another JVM.
* Use the Profiling tool to find the slow place in the program. Eclipse has profiling tools. VISUALVM also has such a function. (If you don't mind using closed source software, try Jprofiler and Yourkit)
* Some JVMs allow code to be updated at run time. Eclipse can be integrated with some JVMs. This allows you to modify the code frequently without restarting the JVM frequently. Useful for some "heavy" projects. (If you do not mind the use of closed-source software, also try Jrebel)

"Multithreading" learns about multithreaded programming in Java and the use of lock, condition (including traditional Java synchronized statements and new java.util.concurrent.*) to learn how to make a thread stop, And why you should frequently confirm isinterrupted () instead of Thread.stop (). Find out how multicore processors, caches, memory relationships, and why multithreaded programming is so difficult.
* If you are comfortable, learn about the usage of runnable and the basic multithreaded tools such as Executer.
* You should have noticed that many of the containers inside java.util are not thread-safe, but java.util.Collections can help you create some secure versions. Also pay attention to java.util.concurrent inside there are concurrentmap and other containers for use.
* If available, look at the memory model and the lock-free sync (see Java storage model and java.util.concurrent.atomic).
* If you are free, see if there are other models besides "Shared memory multithreaded Programming" (Multi-process multi-processing, messaging message passing, etc.).

"Reflection, Metaprogramming" learns the reflection mechanism of Java, and the use of annotation.
* If you are comfortable, try the use of java.lang.reflect.Proxy.
* If still comfortable, play a game of Cglib (a third-party library).

"Network Programming" Learn IP, TCP protocol (computer professional should learn, review), learn socket programming (note that the garbage collector will not help you switch off the socket).
1. If you are not very concerned about HTTP, look at Java.nio, learn single-threaded polling IO multiplexing (Selector).
* If you don't understand the intent of NIO, get to know the c10k problem. Http://
* If the body does not have a strange words, about the operating system (including the C language) provided by the Select, poll, Epoll, Kqueue and other interfaces.
* If the body is still not strange, try to write a file server with Java.nio.
* If you still have the energy, the internet pick up a steak there is no other communication library, such as Netty.
2. If you care about the Web and HTTP, learn about the HTTP protocol and client programming with Java for HTTP.
* If you're comfortable, learn HTML and write static HTML pages (no Java required)
* If you're comfortable, write a Web parser (crawl page) based on DOM, XPath, or CSS selector in Java.
* If you're comfortable, learn Java's servlet interface (don't learn JSP first) for Web server-side programming. Learn how to use the standard servlet container, including the use of Web. XML and the concepts of listener, filter, etc. and the specific use of a servlet container, such as jetty or Tomcat.
* If still comfortable, try learning a template language (such as Haml, Velocity, Freemarker, "Are there other better frameworks?"). I don't know, "String.Format, if you really want to learn JSP, JSP is OK, but not recommended."
* If you still feel comfortable, learn the spring framework in the web framework, or struts, to see your tastes.
* If you're comfortable, take a look at Spring Bean container and all sorts of messy tools inside.
* If you're comfortable, or have a need, find out what a restful Web Service is, review http, and find the right Java tool.
* You might think that Jackson is a useful thing to parse JSON with.

"Database" Learn about relational databases (computer majors should learn, review), including SQL. Choose a database management system to familiarize yourself with (such as mariadb, or (if you don't hate Oracle) with MySQL acquired by Oracle. Learn from Java alone). Then look at their official documentation to teach you how to connect to this database in Java. This will involve the JDBC interface. Also be sure to know the SQL Injection security vulnerability, and how to use PreparedStatement to prevent injection!! Suggested See
* There may be a "transaction" problem in the middle that will let you unknowingly start to understand the Java Transaction API (JTA).
* If you're comfortable, learn about object-relational transformations (such as hibernate).
* You can also learn about non-relational databases and how to access them in Java.

"Logging" Learn about the use of slf4j and Logback.
* If you have the energy, and probably know how many Java log frameworks are in the world, and how SLF4J bridge these frameworks.

Build system learn about ant usage.
* If you're comfortable, learn to use Ivy to download packages from MAVEN's repositories to resolve dependencies.

Versioning learns the basic usage of a distributed versioning controller (such as Git, Mercurial, BZR, Darcs, etc.), and how to use it to manage Java engineering. Hopefully you've started using Maven. Then find out how to use it in the IDE (Eclipse comes with a git plugin).
* If you feel comfortable, build a linux+ssh+git server for your lab and install a Gitlab (a Web interface). and persuade colleagues to stop using old "centralized versioning controllers" such as SVN, CVS, or SourceSafe.
* Open a GitHub account. If you don't like git, use bitbucket and so on.

"Continuous Integration" yourself (or for your lab) build a continuous integration (continuous integration) server, such as Jenkins, to compile your program regularly. It is recommended to use a distributed version controller such as Git.
* If you do open source software, try GitHub and Travis.

"Fragmented Tools" Amoy java.nio.files inside what to use the east, and then Amoy a Amoy apache Commons lang and Commons io have what useful tools. Commons logging do not use again, with SLF4J and Logback.

XML learns XML, DOM, and XPath. XML is something that can be used everywhere. You can also use it to write your own configuration file.
* If you feel uncomfortable, learn json and YAML.
* If still not comfortable, learn to study text file parsing.

"Grammar analysis and Compiler" learn ANTLR or other parser generator usage
* If you feel comfortable, write a calculator yourself.
* If you still feel comfortable, write yourself a domain-specific Language (DSL).

"Efficient containers" learn fastutil or trove, if you need to do a lot of numerical calculations.

"Distributed computing" is the idea of mapreduce and its realization.
* If you're comfortable, learn the Scala language and Apache Spark, which is much faster than MapReduce.

interprocess communication look at Activemq, Mina, and RMI.

Other languages (JVMs) Learn another language or implementation (such as groovy, Scala, Clojure, JRuby, Jython, JavaScript ...) that runs on the JVM. )
* If you are comfortable, learn the Java Scripting API (note that it is not JavaScript.) Give a link:, and then try embedding the script in your own Java program.

Other languages (non-JVM) Learn another common scripting language (such as Python, Ruby, actually Perl is OK, but not recommended) and know when Java is not the best choice.

The Java language and Java virtual machines are read through (Yimushihang, not read) Java Language specification, as well as with Java Virtual Machine specification.
* Learn the concepts of the following interpreter (interpreter), compiler (compiler), instant compiler (Just-in-time compiler), and Optimizer (Optimiser).
* If you are not afraid of the compiler topic, learn the concepts and differences between the method JIT and the tracing JIT.

Several basic algorithms of "memory Management" for garbage collection, including Mark-sweep, Mark-compact, Semi-space, generational, mark-region, etc., their performance, and why the simple reference The counting is not complete. Know why finalizer performance is poor, and the standard does not require finalizer to be executed before the program exits.
* If you're comfortable, find out how to set the heap size limit for Java virtual machines (such as the-XMX option for a hotspot virtual machine).
* Learn about WeakReference in Java and SoftReference and Phantomreference, and when they are useful, and why they are difficult to implement.
* If you have the energy, find out what the memory management algorithm of the hotspot virtual machine is.

Dynamic loading of the Java dynamic loading (class loading)
* If you're comfortable, learn about OSGi and its implementation (such as Felix or Equinox)
* If you are still comfortable, learn to write programs based on the Eclipse platform. Not the Eclipse integrated development environment, just use their graphics framework to write their own applications.
* If you still feel comfortable, write a plugin for the Eclipse integrated development environment.

Local/Foreign Language interface Learn about Java Native Interface (JNI) and try to write a Java and C language mixed programming program.
* If you feel uncomfortable or feel like dying, learn Java Native Access (JNA), try to load the C library directly from Java without any glue code, and call the C function directly.
* If even JNA do not bother to learn, learn swig, automatically generate bindings.
* If you feel comfortable, learn Java Virtual machine Tooling Interface (JVMTI) and use the C program to monitor the state of the JVM.

Cryptography learns cryptography, including coding, cryptanalysis, attacks, symmetric keys, public key systems, digital signatures, hashing algorithms, and so on, to see if Java is implemented.
* If you feel a bit uncomfortable (you should not feel comfortable, unless you are learning cryptography, or you will always feel that your program has a security vulnerability), write a "character calculator" to relax, ask each time to enter the same name, get the character value is fixed, But it is also impossible to use other people's character value to guess their personality values.

"Mobile Terminal" learn one learn Android development.
* If you have the energy, look at the Dalvik virtual machine is going on.
* Suggest buying an iphone or ipad, or you may never want to use an Android phone or tablet.

"History" If you feel a little bored, dig into the history of the possibility of fire and Java-related technologies, such as:
* Applet, think about it than the shortcomings of Html5+css3+javascript.
* AWT, Swing, think about why very few people write GUI programs in Java. Do you think swing's program looks comfortable? Do Chinese and disabled people like to use swing programs?
* JNDI, think of it in comparison to the shortcomings of spring Bean container.
* JSP, think of it compared to the shortcomings of the MVC structure.
* Wsdl/soap, compare them to Xml-rpc, RESTful Web service.
* XSLT, and why it is Turing-complete. But is it really better than Java itself?
* log4j, java.util.logging, Apache Commons logging, what are their problems, and why did the log4j author develop slf4j and Logback?
* Why was Java originally designed?
* Type Erasure What's going on? Why can't arraylist<int>, but arraylist<integer> can? Dig a dig in history.

Advanced Java language Process (RPM)

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: 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.