Java IO explains that in detail

  0x01: byte stream Byte stream base class 1. InputStream InputStream: the base class of byte input stream. The abstract class is a superclass representing all classes of byte input stream. Common methods: // Reads the next byte of data from the input stream abstract int read() // A certain number of bytes are read from the input st ...

Posted by hl_tan on Sat, 27 Nov 2021 22:03:31 -0800

My first JDBC program (to realize the addition, deletion, modification and query of data table) and error analysis and solution.

1. Define your own database and data table 2. Access the defined data table through JDBC and insert 2 records. Requirements: 1. Submit SQL statements defined in database and data table; 2. Submit program implementation process; 3. Submit program running results. This is a small class assignment assigned by my teacher. What is JDBC JDBC(Jav ...

Posted by Lucnet on Sat, 27 Nov 2021 21:47:13 -0800

How to use enumeration to eliminate if/else in Java

Today, I'm going to relearn enumeration types in Java. Why study again now? Because when I first started learning Java, I didn't pay much attention to enumeration. After work, I basically didn't use enumeration. As a result, I don't quite understand the data type of enumeration. Sometimes when I see the enumeration types and related operations ...

Posted by Agtronic on Sat, 27 Nov 2021 20:59:13 -0800

RedisTemplate switches Jedis implementations and common Jedis API s

catalogue RedisTemplate switch Jedis implementation Switch the underlying Jedis API operation Redis RedisTemplate switch Jedis implementation 1. Spring Boot is Lettuce and Jedis The client library provides basic automatic configuration. By default, it is used Lettuce As a client, if you want to switch the Jedis client, there are two steps: ...

Posted by eldee on Sat, 27 Nov 2021 19:42:55 -0800

JAVA thread safety issues

In the process of selling tickets, there are thread safety problems, including duplicate tickets and wrong tickets. Why is this problem? When a thread has not completed the ticket selling operation during the operation of ticket selling, and other threads also participate in the operation of ticket selling, thread safety problems will occur ...

Posted by hustler on Sat, 27 Nov 2021 18:12:12 -0800

Summary of java reflection knowledge points

1. Three ways to obtain class objects hello h = new hello(); //1. Obtain class objects through instance objects Class class1 = h.getClass(); System.out.println(class1); System.out.println(class1.hashCode()); //2. Get class object by object name Class class2 = hello.class; System.out.println(class2); System.out.println(class2.hashCode ...

Posted by castor_troy on Sat, 27 Nov 2021 14:03:43 -0800

Java basics notes summary

1. Overview of arrays and sets Collections and arrays are structures that store multiple data, referred to as Java containers for short. Note: the storage at this time mainly refers to the storage at the memory level, and does not involve persistent storage (. TXT,. JPG,. Avi, in the database). Characteristics of array storage ...

Posted by thebighere on Sat, 27 Nov 2021 12:03:15 -0800

Java Object-Oriented Actual Warfare Simulated Shopping Cart (Day 4)

1. What is object-oriented? stay Java In order to obtain objects, you must first design classes. Class (design drawing): Description of common characteristics of objects; Object: A concrete instance of what really exists The basic format of a class: public class Class name{ 1.Member variables (representing attributes) 2.Member method (repre ...

Posted by coinmagnate@com on Sat, 27 Nov 2021 10:21:26 -0800

Java Reflection: dynamic class loading and overloading

Content index Class loader Class loading system Class loading Dynamic class loading Dynamic class overloading Custom class overload Class load / reload example Java allows you to dynamically load and reload classes at run time, but this function is not as simple and direct as people want. This article will explain how to load and overload cl ...

Posted by semlabs on Fri, 26 Nov 2021 20:05:29 -0800

LeetCode-130 - surrounded area

Surrounded areaTitle Description: give you a matrix board of m x n, which consists of several characters' X 'and' O ', find all areas surrounded by' X ', and fill all' O 'in these areas with' X '.See LeetCode's official website for an example.Source: LeetCode Link: https://leetcode-cn.com/probl... The copyright belongs to Lingkou network. For ...

Posted by fireMind on Fri, 26 Nov 2021 20:00:14 -0800