Recent history of Learning Java

Source: Internet
Author: User

1.java variables are divided into three types, class variables, local variables, member variable class variables are static modifiers of the variable

The 2.java modifier can be divided into two main classes, one accessible modifier protected private public two is the non-accessible modifier final abstract strictfp

The 3.java variable is divided into two main classes, one is the base type including the basic shaping and the Boolean two is the reference type including the class, interface, array


4. Local variable definition must be initialized, otherwise it will be an error

5. Reference data type definition when there is a default value, the default value is null;


6. Classes and interfaces cannot be decorated with private


The 7.Protected access modifier cannot decorate classes and interfaces, and methods and member variables can be declared as protected, but the member variables and member methods of an interface cannot be declared as protected.

8. A method declared as public in a parent class must also be public in a subclass.
A method declared as protected in a parent class is either declared as protected in the subclass or declared as public. cannot be declared as private.
The method declared as private in the parent class cannot be inherited.


9.static modifier, used to create class methods and class variables.
Final modifiers, which are used to modify classes, methods, and variables, the final decorated class cannot be inherited, the decorated method cannot be redefined by the inheriting class, the modified variable is constant, and is not modifiable.
An abstract modifier that is used to create abstract classes and abstract methods.
Synchronized and volatile modifiers, which are used primarily for threading programming.


10. A class cannot be both abstract and final decorated


11. The override parameter type and number of the method must be the same, and the return merit type and number must be the same;


12. The overload of the method must ensure that the parameter type and number must be different, the type of the return value can be the same or not the same;

SQL statements and additions to the search and change commands





Add insert into student (field name, field name) (three-in-one);

Delete delete from student where id=?

Check select from student where id= "HHH";

Change alter student set id= "where name=" ";



13.java call method, you can write a pubic class and many classes in a file, and then invoke the instantiation of the other class in the main method in the public class this is a calling method;


14. Another method of invocation is to put the class in a different file, and then only one file has the main method, so that you can call the other files in the class;


15. This is another method of invocation


16. Access modifiers can modify instance variables;
17. Instance variables are visible to methods, construction methods, or block statements in a class. In general, you should set the instance variable to private. By using the access modifier, the instance variable is visible to the child class;
18. The instance variable has a default value. The default value for a numeric variable is 0, the default value for a Boolean variable is false, and the default value for the reference type variable is null. The value of a variable can be specified at the time of declaration, or it can be specified in a constructor method;


19. Access modifiers cannot be used for local variables;

20. Have similar visibility to instance variables. However, in order to be visible to the consumer of a class, most static variables are declared as public types.


21. The practice of seeking several percentages persent = Math.Round (Tablelist[num][curindex]/total[index] * 10000)/100 + '% ';














































Recent history of Learning Java

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.