Tag:java

  • Java merge list method code example

    Time:2020-11-30

    This article mainly introduces the Java merge list method code example, the article through the example code introduction is very detailed, to everybody’s study or the work has certain reference study value, needs the friend may refer to List includes the list interface and all implementation classes of the list interface. Because the list interface […]

  • Simple understanding of Java’s default and static methods

    Time:2020-11-27

    This article mainly introduces a simple understanding of Java default and static methods, the article through the example code is very detailed, for everyone’s study or work has a certain reference learning value, need friends can refer to On the default and static methods of Java Allowing default and static methods to be declared in […]

  • How do you choose several common assertion styles in Java

    Time:2020-11-26

    In daily work, whether you write unit test or use TDD programming method for development, you will encounter assertions. The common assertion styles include assert and BDD. How do you choose these common assertion styles? 01 assert style JUnit provides such assertion style as: void should_be_unlocked_when_insert_coin_given_a_entrance_machine_with_locked_state() { EntranceMachine entranceMachine = new EntranceMachine(EntranceMachineState.LOCKED); String result = […]

  • Methods and precautions of removing elements in Java collection

    Time:2020-11-25

    1. Preface Operation set is a thing that Java programmers repeat almost every day. Today, let’s look at ways to remove elements from the Java collection. I’ve built a simple collection, and we’ll take this as an example to explore. List<String> servers = new ArrayList<>(); servers.add(“Felordcn”); servers.add(“Tomcat”); servers.add(“Jetty”); servers.add(“Undertow”); servers.add(“Resin”); 2. For loops do not […]

  • Java realizes file upload, download and image preview

    Time:2020-11-19

    This article mainly introduces the Java implementation of file upload, download, image preview, the article through the example code is very detailed, for everyone’s study or work has a certain reference learning value, need friends can refer to Save multiple files locally: @ResponseBody @RequestMapping(value = “/uploadApp”,produces = { “application/json;charset=UTF-8” },method= RequestMethod.POST) public String uploadApp( HttpServletRequest […]

  • Analysis of Java generic wildcard instances

    Time:2020-11-17

    This article mainly introduces the Java generics commonly used wildcard example analysis, the article through the example code introduction is very detailed, to everybody’s study or the work has the certain reference study value, the need friend may refer to Today, I’m looking at the original code of ArrayList. I see such a symbol. I’m […]

  • How to realize the function of Java iterator iterator

    Time:2020-11-15

    This article mainly introduces how to realize the function of Java iterator iterator. It is introduced in detail through the example code, which has certain reference learning value for everyone’s study or work. Friends in need can refer to it Lying in bed today, I suddenly thought of a question: how to realize the code […]

  • Java using TCP to achieve online chat sample code

    Time:2020-11-14

    Client code: package tcp.http; import java.io.*; import java.net.*; import java.util.Scanner; public class Client{ public static void main(String[] args) throws IOException{ Scanner scanner=new Scanner(System.in); //1. Create socket Socket tcpClientSocket=new Socket(); //2. TCP must establish a connection before sending messages Byte [] IPv4 = {127,0,0,1}; // connect to the local computer InetAddress serverAddress=InetAddress.getByAddress(IPv4); SocketAddress serverSocketAddress=new InetSocketAddress(serverAddress,7777); tcpClientSocket.connect […]

  • java ArrayList.remove Three wrong usages and six correct usages of ()

    Time:2020-11-13

    In Java collection, list list should be the most commonly used one. It has two common implementation classes: ArrayList and LinkedList. The bottom layer of ArrayList is an array, which is more convenient to search; the bottom layer of LinkedList is a linked list, which is more suitable for adding and deleting. But in the […]

  • Solution to cross domain problem in Java Server

    Time:2020-11-12

    This article mainly introduces the Java server-side cross domain problem solution, the article through the example code introduction is very detailed, has the certain reference study value to everybody’s study or the work, needs the friend may refer to Now, many developed APIs support Ajax direct request, which will lead to cross domain problems. To […]

  • How to update MAC Java

    Time:2020-11-12

    Some friends will ask how to update the Mac version of Java? Today, I’ll bring you the way to update and upgrade the Mac version of Java based on my own experience. Let’s have a look! Each time you launch a java applet, Java Web start application, or Java control panel, the system starts the […]

  • Detailed explanation of jdk13.0.1 installation and configuration of environment variables (win10 platform as an example)

    Time:2020-11-11

    1、 Download and install Download from Oracle website: https://www.oracle.com/technetwork/java/javase/downloads/index.html , click on the right to download Accept and download the corresponding platform file (win10 as an example) Open the installation package, install all the way, and remember the installation directory My path: F: Java / jdk-13.0.1 Download installation complete 2、 Configure environment variables After jdk12, […]