Java Course Summary

Learned what

This semester by teaching and self-study teacher in Java specific courses to learn the following knowledge:

1. Object-oriented programming

1.1 Classes and Objects (anonymous object)
class is a method and attributes that define a basic template, on behalf of a commonality. Which property may also be variable.
Statement object generator is divided into objects and instantiate the object. Such as:

类名 对象名称 = new 类名();                    //通常通过关键字"new" 创建一个对象 

1.1.1 categories and keywords:

String class with the static keyword

String class is instantiated by direct assignment of a new object (in most cases employed to instantiate new String)

*"=="与"equals"

public class String{
       public static void main(String args[]){
           String str1="hello";
           Stirng str2=new String("hello");
           String str3=str2;
           System.out.println("str1==str2-->"+(str1==str2));               //false
           System.out.println("str1==str3-->"+(str1==str3));              //false
           System.out.println("str2==str3-->"+(str2==str3));             //true

"==" is used for comparison values, and the value of str1 str2 addresses are not equal, the comparison is not equal str1 and str2. and str3 str2 point to the same space, the same address is, therefore, an address value str3 str2 are equal and, similarly, str 1 str3 and address values ​​are not equal, it returns false.

* "==" is used for comparing the address value
to determine the content of the two strings are equal, the need to use "the equals" Method

public boolean equals(String str) ;             //boolean 是 一种返回结果只能是true 或false 的存储数据类型

The difference between "==" and "the equals" of
(1): "==" is provided by Java relational operators, the main function is numerically equal to the determination, if used on a String object memory address represents the comparison value.
(2): "equals () " is to provide a method of String, this method is dedicated to compare the contents of strings.
1.1.2 this key
role: that class of property;
you can use this to call this class constructor;
* only on the first line and the call can not be recycled.
this represents the current object.

1.2.0 Inheritance and abstract classes
subclass inherits the parent class through inheritance extends keyword.
By sub-class extends the parent class functions.
Only single inheritance in Java, a subclass can only inherit from a parent class
1.2.1 super keyword:
1) call the parent class of all non-private constructor;
2) call the properties of the parent class;
3) the parent class method calls.
1.2.2 Method override and overload (P169)
1.2.3 Final keyword
can be used to declare classes, attributes, methods. Wherein the class declaration can not have subclasses, subclasses method can not be overwritten, the variable declaration becomes constant, i.e., can not be modified.

1.2.4 abstract class
specifically the creation of a class as a parent class, known as the "abstract"
class abstract methods must be abstract;
abstract classes and abstract methods must be declared with the abstract keyword;
abstract simply declare the method need not be implemented ;
abstract class can not be called "final" keyword.

1.3 interface with the instanceof keyword
1.3.1 multi-threaded in two ways: inheritance Thread class and Runnable Interface
1.3.2 instanceof keyword

对象 instanceof 类 → 返回 boolean 类型

2. capture and handle exceptions

Need to use try {...} catch {...} statement.
2.1.2 throw and throws keyword (thrown)
2.1.3 Exception class and RuntimeException class

3.Java IO

Class file 3.1File
3.2 RandomAcccessFile stochastic
3.3 byte stream and character stream
3.3.1 Buffer: is a special section of memory, a program operating a resource frequently, in order to improve performance, the part of the data is temporarily read into a memory region of , called buffer.
3.3.2 commutations
OutputStreamWrite classes and class InputStreamReader

4. GUI

import javax.Swing.*;
import java.awt.*;

4.1 layout manager with various assembly
JLabel label assembly
JButton button assembly
FlowLayout flow layout
BorderLayout form layout
GridLayout table format layout
CardLayout card layout
JPanel any layout, which can be added to any component of
the dividing panels JSplitPane class
JTabbedPane based panel tabs
JScrollPane set the scroll bar to browse through
JTextComponent text box assembly
JTextField single-line text entry box
JPasswordField password text entry box
JTextArea multi-line text input box

4.2 Event Processing
4.2.1 events and listeners
4.2.1.1 form event, mouse event, keyboard event handling and monitor
4.2.2 radio button JRadioButton
4.2.3 checkbox JCheckBox
4.2.4 list box JList
4.2.5 menu component JMenu with JMenuBar
4.2.6 file selection box JFileChooser

https://www.cnblogs.com/ImportantMagic/p/11906985.html

5. java database (entry)

Just completion soon:
https://www.cnblogs.com/ImportantMagic/p/11959922.html

Learning Summary:
With the help of teachers and students of this semester, I learned a lot about the java, here to thank the teachers and Li Jin Yu Li Qi assistant there are those students who helped me.

1. compiled by the environment before using DEV-C ++ to now been using Eclipse, which is the first step in learning Java.
2. learned an important Java programming ideas: that the language is object-oriented programming.
3. classroom, the teacher is very interesting and detailed, makes me easier to understand this course, but only to understand, due to the after-school time is not spent too much, cause I fall too much on this course, many things now look less likely. Such as event handlers and listeners.
4. After class one will occasionally browse the Internet from some Java knowledge, the class did not understand some things from the Internet can understand, this is my way of learning.
5. freshman left programming flaws, to learn Java or did not completely fill and correct, this is a thing of shame I felt. Winter time is so long, I have to carry to fill these knowledge gaps. Some programming but also self-knowledge, such as web programming.

Part of the learning I usually used website:
https://www.runoob.com/
https://www.w3cschool.cn
https://www.bilibili.com/
http://www.javaxx.com/java/

Guess you like

Origin www.cnblogs.com/ImportantMagic/p/12024761.html