Java can also be executed directly without compiling?

We all know that java is a static language, that is to say, if you want to execute a java program, you must compile it first and then execute it. So why does this article say that java can be executed without compiling? Actually, this is a new feature added in OpenJDK11 to enable the java source code of a single file to be executed directly wit ...

Posted by jcantrell on Sun, 11 Aug 2019 06:19:30 -0700

ReentrantLock Explains Lock Interruptibly Method for JAVA Multithread High Concurrency

Locking is usually considered to ensure thread safety in multi-threaded high concurrency scenarios in JAVA. But in special scenarios, we can also use thread-safe objects provided by the java.util.concurrent package to avoid locking and achieve high efficiency. However, these thread-safe objects only ...

Posted by dotBz on Sat, 10 Aug 2019 03:52:08 -0700

Java Concurrency Guide 11: Interpreting Java BlockingQueue

Interpreting Java Concurrent Queue BlockingQueue From: https://javadoop.com/post/java-concurrent-queue Recently, I want to write an article to talk about the java thread pool problem. I believe that many people do not know anything about it, including myself. Before I carefully looked at the source code, there were also many puzzles, even som ...

Posted by sylesia on Fri, 09 Aug 2019 22:32:42 -0700

Java Reference Type Principle in-depth analysis, read the article, 90% of the people are in the collection

There are four reference types in Java (there are actually other reference types such as FinalReference): strong reference, soft reference, weak reference, virtual reference. Strong references are Object a = new Object(), which we often use; in this form, there is no corresponding Reference class in Java. This article mainly analyses the imple ...

Posted by ca87 on Fri, 09 Aug 2019 01:11:07 -0700

Java design pattern optimization - singleton pattern

Overview of Singleton Patterns Singleton pattern is an object creation pattern used to generate specific instances of a class. Using the singleton pattern ensures that only one instance of the singleton class is generated throughout the system. There are two main benefits: For frequently created objects, the creation time after the first inst ...

Posted by cedricm on Wed, 07 Aug 2019 06:06:39 -0700

Java - Does multithreading really use all the cores of the CPU?

Original Link: https://mp.weixin.qq.com/s?__biz=MzA4NjgxMjQ5Mg==&mid=2665762396&idx=1&sn=694e2a61e0778672d4f1684bfc6a956a&chksm=84d21c7fb3a59569a6f63e4be64c2e5fa0fb60c5c871f20c91ca44ce3067e40256bf64047ace&mpshare=1&scene=24&srcid=&sharer_sharetime=1564448485523&sharer_s ...

Posted by jgires on Sun, 04 Aug 2019 18:00:02 -0700

13 - Junit Unit Testing + Reflection + Annotation + Dynamic Agent

1. Junit Unit Testing 1. Background: The problem with writing code test in main method is that all code is written in main method and will run. If we want to test, we will execute all code and the test efficiency will be lower. 2. Concept: Unit testing is testing part of the content. Junit is a th ...

Posted by Javizy on Fri, 02 Aug 2019 02:41:36 -0700

Memory Manager ByteBufAllocator and Memory Allocator

ByteBufAllocator Memory Manager: The top-level abstraction of memory allocation in Netty is ByteBuf Allocator, which allocates all ByteBuf-type memory. In fact, there are not many functions, mainly the following important API s: public interface ByteBufAllocator {/**Allocate a block of memory to automatically determine whether to allocate i ...

Posted by evil turnip on Thu, 01 Aug 2019 21:45:59 -0700

Spring's component scan annotations

Scan Spring's component classes by annotating @ComponentScan on the class. Optional parameters for @ComponentScan basePackages: Specifies the root package directory that needs to be scanned, and its subdirectories will also be scanned. The default path is the @ComponentScan annotation class directory and its subdirectories Alias for value:base ...

Posted by bluto374 on Thu, 01 Aug 2019 11:43:18 -0700

Developing desktop applications in java - javaFx (learning development process)

Catalog Preface development environment development process How to Build a javaFx Project Integrated maven xml resources could not be found after integrating maven How to Implement Custom TabPane How to introduce custom css Project Packing Ex Running File (idea Edition) Project Packing Ex R ...

Posted by tonymontana on Thu, 01 Aug 2019 03:04:39 -0700