Java object-oriented package and inheritance

Java object-oriented package and inheritance ⚡ Preface ⚡ ️ This article records the blogger's study of the object-oriented part and introduces you to the basic knowledge of Java - package and inheritance. The subsequent content will be continuously updated. (please understand that the first half of se basic grammar has not been updated due t ...

Added by alarik149 on Sun, 30 Jan 2022 06:02:40 +0200

Generic extensions and super wildcards

extends wildcard First define a class: class User<T> { private T t1; private T t2; public User() { } public User(T t1, T t2) { this.t1 = t1; this.t2 = t2; } public T getT1() { return t1; } public void setT1(T t1) { this.t1 = t1; } public T getT2() { r ...

Added by Rodders on Fri, 28 Jan 2022 15:41:02 +0200

Java basic syntax -- selective sorting, bubble sorting, and the use of binary search method and Arrays class

This article will take you to understand the principle and code implementation of selective sorting, bubble sorting and binary search method, as well as some operations on Arrays through the Arrays class 1, Select sort    selection sorting is to start from the first number, compare with all numbers in turn, put the maximum (de ...

Added by mator on Fri, 28 Jan 2022 11:41:46 +0200

[Java] takes you from zero to a series of 18 exceptions

Foreword: in addition to learning so much basic knowledge of Java, there is one thing we can't avoid when typing code, that is exception. So in this article, let's learn about exceptions to see what exceptions are in Java, what they are used for, and where they come from. Each picture: I Abnormal background 1. Initial knowledge ab ...

Added by pedrolopes10 on Wed, 26 Jan 2022 10:54:35 +0200

Day9 I Object oriented thinking II Memory area analysis III Member variables and local variables

I Object oriented thought Process oriented and object-oriented are both ways to solve problems Process oriented: write code from top to bottom according to business logic; It emphasizes that the steps, processes and every step are realized by yourself. Object oriented: create objects, use objects, and command objects to do things. Object or ...

Added by MHz on Tue, 25 Jan 2022 20:20:40 +0200

Analysis of LongAdder source code of Java8 atomic bomb

Analysis of LongAdder source code of Java8 atomic bomb Starting from JDK 8, Java provides longadder for Long atomic operations LongAccumulator; For Double type, Java provides Double adder and Double accumulator. Striped64 UML AtomicLong is internally a volatile long variable, which is operated by multiple threads. Multiple threads perform ...

Added by maxf on Mon, 24 Jan 2022 18:42:55 +0200

Read getResourceAsStream in java

I summary When reading the configuration file, you will always struggle with the problem of path. In fact, all path problems can't escape a few keywords Relative path, absolute path, classpath First, let's introduce these paths Relative path: Relative path: as the name suggests, the path is relative. For example, the current path is tes ...

Added by rationalrabbit on Sat, 22 Jan 2022 09:47:02 +0200

Know and understand Object class

catalogue Object class 1. toString() 2. equals() 3. hashCode() Object class We say that the object class is the parent class of all classes (all classes here include classes defined in java and classes created by yourself). All classes inherit object by default and are the ancestors of all classes Objects of all our classes can be recei ...

Added by brucensal on Fri, 21 Jan 2022 07:10:01 +0200

IO flow - power node notes

@author: posper @date: 2021/7/8-2021/7/9 @version: v1.0 This document is based on Power node IO flow p720-756 finishing IO stream Classification of IO streams Classify according to the direction of the flow (take the memory as the reference): Input stream Going to memory is called input. Or read Output stream Comi ...

Added by chrys on Fri, 21 Jan 2022 04:30:46 +0200

[JavaSE] Chapter 11 generics

11.1 role of generics 11.1.1 concept of generics The so-called genericity is to allow an identifier to represent the type of an attribute in a class or the return value and parameter type of a method when defining a class or interface. This type parameter will be determined when used (for example, inheriting or implementing this interface, d ...

Added by intenseone345 on Thu, 20 Jan 2022 23:55:33 +0200