Java interview questions, can the singleton pattern you wrote prevent deserialization and reflection?

preface Speaking of singleton mode, I believe everyone will not be unfamiliar. Because compared with other design patterns, it is relatively simple to implement a singleton pattern. Singleton pattern means that a class has only one instance. To obtain instances of a class, we often use the new keyword, but we should ensure that a class can on ...

Added by paulnaj on Sat, 29 Jan 2022 15:02:55 +0200

Java interview 2021, Tomcat's immortality - Embedded

Author: Mr. King of Xiangxue classroom Reprint, please state the source! preface Tomcat is a very popular web server for deploying and running Java Web applications. Generally, we run our own web applications on a separate Tomcat instance. In fact, compared with this classic scheme, we can directly integrate the server runtime into the ap ...

Added by youknowho on Sat, 29 Jan 2022 12:29:19 +0200

Thread communication, wait() and notify() / notifyAll(), producer consumer issues, jdk5 0 new thread creation method, thread pool related API

Thread communication Example: print 1-100 using two threads. Thread 1 and thread 2 print alternately package com.atguigu.java2; /** * Example of thread communication: use two threads to print 1-100, thread 1 and thread 2 to print alternately * * Three methods involved: * wait(): Once this method is executed, the current thread enters a ...

Added by owned on Fri, 28 Jan 2022 19:49:44 +0200

How is the hashCode value of Java generated? Is it related to the memory address of the object?

How is the hashCode value of Java generated? Is it related to the memory address of the object? First look at the simplest print System.out.println(new Object()); The fully qualified class name and a string of strings of this class will be output: java.lang.Object@6659c656 @What is after the symbol? Is it hashcode or the memory address o ...

Added by Geteburg on Fri, 28 Jan 2022 13:51:45 +0200

Android interview summary - how is ViewModel saved and restored?

Combined with the previous article Android interview summary - ViewModel We know: When the configuration changes, the Activity#onRetainNonConfigurationInstance() will be called to save the ViewModel The object mViewModelStore of the example is called and getViewModelStore() is called after the Activity is rebuilt. ensureViewModelStore() cal ...

Added by foreverhex on Fri, 28 Jan 2022 03:22:53 +0200

Common methods of js array

1. join() join is to convert an array into a string, and then specify a connecting character for it. The default is comma (,) Writing format: join(""), write a string in parentheses ("quotation marks required"), var arr = [1,2,3]; console.log(arr.join());  // 1,2,3 console.log(arr.join("-")); // 1-2-3 console.log(arr); ...

Added by Pha on Thu, 27 Jan 2022 09:21:04 +0200

Project summary of grain College

Project summary of grain College 1. Project introduction 1.1 business model adopted B2C mode (Business To Customer member mode) Merchants to users, this mode is to make a large number of videos with their own copyright and put them on their own platform, so that users can pay monthly or annual fees. This model is simple and fast. I ...

Added by polywog on Wed, 26 Jan 2022 21:53:23 +0200

The most detailed source code analysis of Spring core IOC (different insights every time) 2

The most detailed source code analysis of Spring core IOC (different insights every time) The most important concepts of Spring are IOC and AOP. This article is actually to lead you to analyze the IOC container of Spring. Since we usually use Spring, how can we not have a good understanding of Spring? Reading this article will not make you a S ...

Added by gl_itch on Tue, 25 Jan 2022 18:56:53 +0200

Notes - browser built-in objects

What is the browser object model BOM: Browser Object Model. The browser model provides an object structure that is independent of content and can interact with the browser window, which is the API provided by the browser. Its main objects are: window object, the core of BOM, is the interface for JS to access the browser and the Global obj ...

Added by Rochtus on Mon, 24 Jan 2022 22:38:48 +0200

Understand the use of completable future

preface There are only two ways to create a Thread: inherit the Thread or implement the Runnable interface. However, both methods have a defect that they do not return a value After Java 1.5, you can obtain a Future object containing the return value by submitting a Callable to the thread pool Limitations of Future interface When the Future ...

Added by morphy@6deex on Mon, 24 Jan 2022 21:53:29 +0200