Java object-oriented -- method overloading -- construction method -- this keyword ------ (XV)
1, What is an object
Object Oriented Programming:
All objective things are objects, and all things are objects
Any object must have its own characteristics and behavior
→ features: → attributes, usually nouns, represent what the object has
Object
→ behavior: → method, usually a verb, represents what the obj ...
Added by sunsun on Sun, 02 Jan 2022 20:35:48 +0200
[JAVA] notes (20) -- deadlock; How to solve thread safety problems; Daemon thread; Timer; Callable implementation thread; wait() and notify(); Realize the producer and consumer model;
Deadlock:
1. Features: since deadlock will not cause exceptions or errors, the program will always be stuck here, so this error is difficult to debug;
2. Deadlock model:
public class ThreadPra1 {
public static void main(String[] args) {
//Create object1, object2 objects
Object object1=new Object();
Object object2=ne ...
Added by Grisu on Sat, 04 Dec 2021 06:37:32 +0200