开始学习java多线程编程。
This commit is contained in:
		
							
								
								
									
										25
									
								
								多线程编程/MultiThread/pom.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								多线程编程/MultiThread/pom.xml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,25 @@
 | 
			
		||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 | 
			
		||||
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 | 
			
		||||
  <modelVersion>4.0.0</modelVersion>
 | 
			
		||||
 | 
			
		||||
  <groupId>com.cpic.xim</groupId>
 | 
			
		||||
  <artifactId>MultiThread</artifactId>
 | 
			
		||||
  <version>1.0-SNAPSHOT</version>
 | 
			
		||||
  <packaging>jar</packaging>
 | 
			
		||||
 | 
			
		||||
  <name>MultiThread</name>
 | 
			
		||||
  <url>http://maven.apache.org</url>
 | 
			
		||||
 | 
			
		||||
  <properties>
 | 
			
		||||
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 | 
			
		||||
  </properties>
 | 
			
		||||
 | 
			
		||||
  <dependencies>
 | 
			
		||||
    <dependency>
 | 
			
		||||
      <groupId>junit</groupId>
 | 
			
		||||
      <artifactId>junit</artifactId>
 | 
			
		||||
      <version>3.8.1</version>
 | 
			
		||||
      <scope>test</scope>
 | 
			
		||||
    </dependency>
 | 
			
		||||
  </dependencies>
 | 
			
		||||
</project>
 | 
			
		||||
							
								
								
									
										18
									
								
								多线程编程/MultiThread/src/main/java/com/cpic/xim/App.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								多线程编程/MultiThread/src/main/java/com/cpic/xim/App.java
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: Kane
 | 
			
		||||
 * @Date: 2023-11-29 23:56:18
 | 
			
		||||
 * @LastEditors: Kane
 | 
			
		||||
 * @FilePath: /MultiThread/src/main/java/com/cpic/xim/App.java
 | 
			
		||||
 * @Description: 
 | 
			
		||||
 * 
 | 
			
		||||
 * Copyright (c) ${2023} by Kane, All Rights Reserved. 
 | 
			
		||||
 */
 | 
			
		||||
package com.cpic.xim;
 | 
			
		||||
 | 
			
		||||
public class App 
 | 
			
		||||
{
 | 
			
		||||
    public static void main( String[] args )
 | 
			
		||||
    {
 | 
			
		||||
        System.out.println( Thread.currentThread().getName() );
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,19 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: Kane
 | 
			
		||||
 * @Date: 2023-11-30 00:03:20
 | 
			
		||||
 * @LastEditors: Kane
 | 
			
		||||
 * @FilePath: /MultiThread/src/main/java/com/cpic/xim/utils/MyThread.java
 | 
			
		||||
 * @Description: 
 | 
			
		||||
 * 
 | 
			
		||||
 * Copyright (c) ${2023} by Kane, All Rights Reserved. 
 | 
			
		||||
 */
 | 
			
		||||
package com.cpic.xim.utils;
 | 
			
		||||
 | 
			
		||||
public class MyThread extends Thread
 | 
			
		||||
{
 | 
			
		||||
    @Override
 | 
			
		||||
    public void run()
 | 
			
		||||
    {
 | 
			
		||||
        super.run();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										38
									
								
								多线程编程/MultiThread/src/test/java/com/cpic/xim/AppTest.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								多线程编程/MultiThread/src/test/java/com/cpic/xim/AppTest.java
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,38 @@
 | 
			
		||||
package com.cpic.xim;
 | 
			
		||||
 | 
			
		||||
import junit.framework.Test;
 | 
			
		||||
import junit.framework.TestCase;
 | 
			
		||||
import junit.framework.TestSuite;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Unit test for simple App.
 | 
			
		||||
 */
 | 
			
		||||
public class AppTest 
 | 
			
		||||
    extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * Create the test case
 | 
			
		||||
     *
 | 
			
		||||
     * @param testName name of the test case
 | 
			
		||||
     */
 | 
			
		||||
    public AppTest( String testName )
 | 
			
		||||
    {
 | 
			
		||||
        super( testName );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return the suite of tests being tested
 | 
			
		||||
     */
 | 
			
		||||
    public static Test suite()
 | 
			
		||||
    {
 | 
			
		||||
        return new TestSuite( AppTest.class );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Rigourous Test :-)
 | 
			
		||||
     */
 | 
			
		||||
    public void testApp()
 | 
			
		||||
    {
 | 
			
		||||
        assertTrue( true );
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user