Home> Network programming tutorial
All ASP tutorial ASP tutorial ASP.NET tutorial PHP tutorial JSP tutorial C#/CSHARP tutorial XML tutorial Ajax tutorial Perl tutorial Shell tutorial Visual Basic tutorial Delphi tutorial Mobile development tutorial C/C++ tutorial Java tutorial J2EE/J2ME Software engineering
Network programming tutorial
  • About the method of struts returning object json format data

    About the method of struts returning object json format data

    If you want to return the json data of an object in struts, copy the code by definition as follows: <action name="getUserByName" method="getUserByName"><result name="success" type="json">userInfo</res
    2024-11-19
  • JSP page pageEncoding and contentType attributes

    JSP page pageEncoding and contentType attributes

    JSP needs to be "encoded" twice. The first stage will use pageEncoding, the second stage will use utf-8 to utf-8, and the third stage is the web page produced by Tomcat, using contentType. Regarding the difference between the pageEncoding and co
    2024-11-19
  • How to call Alipay interface using struts

    How to call Alipay interface using struts

    1. Useless packages with key ACTION codes can be deleted. The copied code is as follows: package com.hzdracom.alipay.action;import it.sauronsoftware.base64.Base64;import java.io.IOException;import java.io.PrintWriter;import java.net.HttpURLConnection;impo
    2024-11-19
  • Execution order of free blocks in Java

    Execution order of free blocks in Java

    Free blocks in Java are divided into static free blocks and non-static free blocks. The execution time of non-static free blocks is: before executing the constructor. The execution time of the static free block is: executed when the class file is loaded.
    2024-11-19
  • Thoughts about the singleton pattern triggered by review

    Thoughts about the singleton pattern triggered by review

    I discovered a situation during code debugging, that is, when I checked the connections of memcached, I found that it was always maintained at about 100. Of course, this seems to be no problem, because memcached has 1024 connections by default. But what I
    2024-11-19
  • How to call .dll files in Java

    How to call .dll files in Java

    Below is a screenshot of the JNative component jnative.sourceforge.net/ Go here to download the JNative open source project. I downloaded the 1.3.2 decompression JNative-<st1:chsdate isrocdate="False" islunardate="False" day="3
    2024-11-19
  • Java implementation method of redefining arrays (similar to VB's ReDim)

    Java implementation method of redefining arrays (similar to VB's ReDim)

    Copy the code as follows: //param objArr the expanded object of Array. //param newLength the length of the new Array public static Object getNewArr(Object objArr, int newLength) { if (!objArr.getClass().isArray()) {//Judge the type return null; } // get t
    2024-11-19
  • Java various slide switching effects (classic)

    Java various slide switching effects (classic)

    Functional implementation: 1. Image loading class ImageLoader implementation: 1) Use blocking queue to store the desired image: BlockingQueue images = new ArrayBlockingQueue<>(2); 2) Use image eof to indicate the end of the image queue: Image eof =
    2024-11-19
  • Java string word frequency statistics example code

    Java string word frequency statistics example code

    Copy the code as follows: package com.gpdi.action; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; public class WordsStatistics { class Obj { int count; Obj(int count){ this.
    2024-11-19
  • A small example of converting floating point numbers into RMB using Java

    A small example of converting floating point numbers into RMB using Java

    Copy the code as follows: import java.util.ArrayList; import java.util.List; public class RMBConverter2 implements IRMBConverter { private static final String [] RMB_NUMBER ={"zero","one","two","three", "四&quot
    2024-11-19
  • Java implementation method of two-dimensional array matrix multiplication

    Java implementation method of two-dimensional array matrix multiplication

    复制代码代码如下:public interface IMatrixMultiple { public int[][] mmltiple(int[][]a ,int [][]b); } ?public class MatrixMultiple implements IMatrixMultiple { @Overridepublic int[][] mmltiple(int[][] a, int[][] b) { int [][] result = new int[a.length][b[0].length]
    2024-11-19
  • URL breakpoint download in Java

    URL breakpoint download in Java

    Copy the code as follows: URL ur = new URL("http://localhost:8080/first/he.txt");HttpURLConnection conn = (HttpURLConnection) ur.openConnection();//URL.openConnection() --> return URLCommection (direct subclass HttpURLConnection)conn.setReque
    2024-11-19
  • JAVA time interval string validity verification

    JAVA time interval string validity verification

    Copy the code as follows: String[] zone1="08:30-11:00".split("-");String[] zone2="13:00-17:00".split("-");String [] actzone="9:00-11:00".split("-");DateFormat df = new SimpleDateFormat("hh:m
    2024-11-19
  • The difference between static keyword and final keyword in java

    The difference between static keyword and final keyword in java

    static1. In a class, attributes modified with static are called static attributes. It is common to all objects of this class and is stored in the static storage area. All objects of this class can access and access the same variable. Can be used as a coun
    2024-11-19
  • Implementation method of Java multi-threaded download

    Implementation method of Java multi-threaded download

    Copy the code as follows: package cn.me.test;import java.io.InputStream;import java.io.RandomAccessFile;import java.net.HttpURLConnection;import java.net.URL;/*** Multi-threaded download* 1: Use RandomAccessFile to write data at any location. *2: The amou
    2024-11-19