How to learn Java

The introductory stage is mainly to cultivate the programming ideas of the Java language. Understand the syntax of the Java language, writing specifications, etc., master development tools such as Eclipse, MyEclipse, and the ability to write Java code. After completing this stage, you should be able to develop small applications and perform basic addition, deletion, modification, and query management on the database. Note: In this stage of knowledge point learning, there will be real projects to drive learning, allowing you to easily understand each knowledge point.

1 Computer Basics

For those who have zero basic learning, from the understanding of computer operation and other knowledge, it extends to the development of Java language and the use of development tools. It is mainly to let you know how to execute computer commands, to know the language of Java, and to feel how the programming language Java develops programs.

1) Computer Basics

Let people who have zero basic learning first understand computer-related knowledge, and then go to understand the Java language.

2) DOS common commands

Understand what DOS is, and master how to open the DOS console, and be familiar with common DOS commands, such as: switching drive letters, entering a specified directory, deleting files, etc., to complete the use of DOS commands to operate and control the computer.

3) Java Overview

Learn about the development history of the Java language, the version of the Java language platform, the characteristics of the Java language, and the JRE and JDK. JRE is the runtime environment of Java, and JDK is the Java Development Kit, which includes Java development tools and JRE. So after installing the JDK, there is no need to install the JRE separately.

4) JDK environment installation configuration

Knowing what JDK is and the importance of JDK, the next step is to learn how to install and configure the JDK environment. Before installing JDK, we first need to download JDK. For different systems, we need to download different versions of JDK.

5) Environment variable configuration

Understand path and classpath environment variables, understand the role of path variables and classpath variables, and master the configuration methods of path variables and classpath variables.

6) Getting started with Java programs

When the JDK and environment variables are configured, we can start writing Java programs. The following tools can be used to write Java programs: notepad (included with Microsoft operating system), Editplus, Notepad++, Eclipse, MyEclipse, sublime, etc.

2 Programming Basics

This module learning is to let you understand the specific process of programming, learn the format of basic Java syntax, etc. Specifically, it is necessary to master the definition and use of variables of different data types, the operation rules of different operators, the execution process of flow control statements, the declaration and invocation of writing methods, and the creation of arrays and access to array elements.

 

1) Notes

In a program development project, the text used to explain and describe the program is called a comment. The comments in Java are divided into the following types: single-line comments, multi-line comments, and documentation comments.

2) Keywords

Understand the meaning and characteristics of Java keywords, and master the precautions for using keywords.

3) Identifier

Learn what identifiers are, the rules for how identifiers are formed, and the precautions when using identifiers.

4) Constants and Variables

Understand the meaning of constants and variables, and master the difference between constants and variables, the definition format of variables, and the assignment of variables.

5) Data type

Master the data types of the Java language, such as basic data types: byte, short, int, long, float, double, char, boolean, and reference types: classes, interfaces, and arrays.

6) Operator

Proficiency in operators in Java: arithmetic operators, assignment operators, comparison operators, logical operators, bitwise operators, ternary operators.

7) Flow Control Statement

Understand what flow control statements are, master the following flow control statements: sequence structure, selection structure, loop structure, and be able to achieve specific functions through flow control statements.

8) Method

Master the definition and format of methods, and be able to call methods correctly, understand the calling process of methods, and understand the precautions of methods; master method overloading and its characteristics.

9) Array

Understand the concept of arrays, master the definition format, static initialization and dynamic initialization of arrays, and be able to understand the memory diagram of arrays in Java. Proficient in traversing arrays, getting the most value, reversing array elements, finding array elements, array sorting and binary search, as well as the definition format and initialization of two-dimensional arrays.

3 Object Oriented

 

In the real world, a kind of thing that can be seen everywhere is the object, and the object is the entity of the existence of things, such as human beings, desks, computers, high-rise buildings and so on. The way humans solve problems is always to simplify complex things, and then think about what parts these objects are made of. Objects are usually divided into two parts, a dynamic part and a static part. The static part, as the name implies, is the part that cannot be moved. This part is called "attributes". Any object will have its own attributes, such as a person, which includes attributes such as height, weight, gender, and age. However, what actions a person with these properties will perform is also a worthwhile part to explore. The person can cry, smile, talk, walk. These are the behaviors that this person has (the dynamic part). Behavior understands objects.

1) Object-oriented thinking

Understand the idea of ​​process-oriented programming, be able to understand the idea of ​​object-oriented programming in Java through cases , and understand object-oriented development, design, and characteristics.

2) Classes and objects

Understand what is a class, what is an object, and understand the relationship between classes and objects; master the definition of classes, object memory graphs, etc.

3) Member variables and local variables

Learn what is a member variable, what is a local variable, and grasp their differences in terms of their location in the class, location in memory, lifetime, initialization value, and more.

4) Anonymous objects

Learn what an anonymous object is and master the two use cases for anonymous objects.

5) Package

Have a clear understanding of what encapsulation is, be able to understand the advantages and disadvantages of encapsulation, and master the principles of encapsulation.

6) this keyword

Master the meaning and use of this keyword.

7) Construction method

Learn what constructors are, what constructors do, and considerations related to constructors.

8) Inheritance

Understand what inheritance is, the benefits of inheritance, the characteristics and precautions of inheritance in Java, the relationship between member variables, constructor methods, member methods in inheritance, and the difference between method overriding and method overloading.

9) Polymorphism

Understand what polymorphism is, master the characteristics of polymorphism cases and member access, the advantages and disadvantages of polymorphism, and the transformation problems in polymorphism.

10) Abstract class

Learn what an abstract class is, the characteristics of an abstract class, and the characteristics of an abstract class member.

11) Interface

Understand what is an interface, the characteristics of interfaces, the characteristics of interface members, the relationship between classes and classes, classes and interfaces, and the difference between abstract classes and interfaces.

12) Inner class

What is an inner class, the access characteristics of inner classes, the location of inner classes, what are member inner classes, local inner classes, anonymous inner classes, and the use of anonymous inner classes in development.

 

4 common classes

A class library is a Java API (Application Programming Interface), which is a collection of implemented standard classes provided by the system. In program design, rational and full use of the classes and interfaces provided by the class library can not only complete the work of string processing, drawing, network application, mathematical calculation, etc., but also greatly improve the programming efficiency, making the program concise and easy to understand .

Learning content: Master Object class, Scanner class, String class, StringBuffer class, StringBuilder class, Arrays class, basic packaging class, regular expression, Math class, Random class, System class, Date class, DateFormate class, Calendar class, and other classes common method.

5 collections

Collection classes store references to objects, not the objects themselves. For the convenience of expression, we call the objects in the collection the references to the objects in the collection. Simply put, a collection is a container for storing data.

Learning content: What is a collection ? What is the difference between an array and a collection, the characteristics of collection classes, master the Collection interface, Iterator interface, List interface, ListIterator interface, ArrayList class, Vector class, LinkedList class, generics, Set interface, HashSet class, Map interface, HashMap class, LinkedHashMap class, etc.

 

6IO

IO (Input/Output) is the interface of computer output/output. Java's core library java.io provides a comprehensive IO interface, including: file reading and writing, standard device output, and more. IO in Java is stream-based for input and output, and all data is serialized and written to the output stream, or read from the input stream.

1) Exception

Understand what an exception is, the origin of an exception, common exceptions, classification of exceptions, master jvm's default handling plan for exceptions, exception handling plans: try...catch...finally, throws, what is a compile-time exception, what is a runtime exception , master the difference between the two, throws keyword, throw keyword, and the difference between these two keywords, master custom exceptions, and precautions for exceptions.

2) File class

Understand what the File class is, the purpose of the File class, and master the methods of the File class: createNewFile(), mkdir(), mkdirs(), delete(), renameTo(File dest), isDirectory(), isFile(), exists() , and other methods, as well as the basic and advanced access methods of the File class.

3) IO style

Understand what is IO stream and the purpose of IO stream; master common base classes of input stream, output stream, character stream, byte stream and IO stream; how to use byte stream to read, write and copy data; what is byte buffer Stream, how to use byte buffer stream to read and write data; what is conversion stream, how to use conversion stream to read and write data more efficiently, memory operation stream, print stream, standard input and output stream, serialization stream, Properties collection.

4) IO stream practice

(1) Copy the text file;

(2) Copy the picture;

(3) Store the string data in the ArrayList collection to a text file;

(4) Read data from the text file (one string data per row) into the collection, and traverse the collection;

(5) Copy the unipolar folder;

(6) Copy the specified file in the unipolar folder and modify the file name;

(7) Copy the multi-pole folder;

(8) It is known that there is such a string in the s.txt file: "hcexfgijkamdnoqrzstuvwybpl";

(9) Please write a program to read the data content, sort the data and write it into ss.txt;

(10) Get the line number of each read data;

(11) Log in to register the IO version.

7 Multithreading

It refers to the technology that realizes the concurrent execution of multiple threads from software or hardware. Computers with multi-threading capabilities have hardware support to be able to execute more than one thread at a time, thereby increasing overall processing performance. Systems with this capability include symmetric multiprocessors, multicore processors, and chip -level multithreading or simultaneous multithreading processors. In a program, these independently running program segments are called "threads" (Thread), and the concept of programming using it is called "multithreading (Multithreading)". A computer with multi-threading capability can execute more than one thread (translated as "thread" in Taiwan) at the same time due to hardware support, thereby improving the overall processing performance.

1) Multithreading

Understand what is threading, what is multithreading, understand the operation principle of java program, master the implementation scheme of multithreading, how to get and set thread name, thread life cycle, how to solve thread safety problem, thread synchronization, Lock lock, deadlock Problems, inter-thread communication, thread states and state transitions, thread pools.

2) Multi-threaded interview questions

(1) There are several implementation schemes for multi-threading, and which ones are they?

(2) There are several ways of synchronization, what are they?

(3) Is it run() or start() to start a thread? What is the difference between them?

(4) The difference between sleep() and wait() methods;

(5) Why wait(), notify(), notifyAll() and other methods are all defined in the Object class;

(6) The life cycle diagram of the thread.

3) Design Patterns

Understand what design patterns are, the classification of design patterns, and be proficient in singleton design patterns (lazy, hungry).

Network programming

The main task of network programming is to assemble the information through the prescribed protocol at the sending end, and parse the packet according to the prescribed protocol at the receiving end, so as to extract the corresponding information and achieve the purpose of communication.

9 Reflections

The JAVA reflection mechanism is that in the running state, for any class, you can know all the properties and methods of the class; for any object, you can call any of its methods and properties; this dynamically obtained information and dynamic call The function of the method of the object is called the reflection mechanism of the java language.

 

In the introductory learning stage of Java , not only relying on theoretical knowledge, but also more practice. When encountering difficulties, let go of the problems in your hands, think more, and your ideas will gradually become smoother.

Reference: http://www.makeru.com.cn/ Java Learning Exchange Group: 587131012    

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324548343&siteId=291194637