This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package pig.review.jave; | |
| public class Test1DimArrayEx2 { | |
| public static void main(String[] args) { | |
| for (int i = 0; i < args.length; i++) { | |
| System.out.println("args[" + i + "]=" + args[i]); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package pig.review.jave; | |
| public class HWFibonaccSeries { | |
| //FibonaccSeries => 0 1 1 2 3 5 8 13 21...... | |
| public void process(int nth){ | |
| long[] data =new long[nth]; | |
| for (int i=0;i<data.length;i++){ | |
| if (i<=1){ | |
| data[i]=i; | |
| System.out.println(i+"th="+data[i]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> | |
| <display-name>WebJDBC</display-name> | |
| <welcome-file-list> | |
| <welcome-file>index.html</welcome-file> | |
| <welcome-file>index.htm</welcome-file> | |
| <welcome-file>index.jsp</welcome-file> | |
| <welcome-file>default.html</welcome-file> | |
| <welcome-file>default.htm</welcome-file> | |
| <welcome-file>default.jsp</welcome-file> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <build> | |
| <sourceDirectory>src</sourceDirectory> | |
| <plugins> | |
| <plugin> | |
| <artifactId>maven-compiler-plugin</artifactId> | |
| <version>3.6.1</version> | |
| <configuration> | |
| <source>1.8</source> | |
| <target>1.8</target> | |
| </configuration> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Tight Coupling Code Ex: | |
| public interface SortAlgorithm { | |
| } | |
| public class BubbleSortAlgorithm implements SortAlgorithm { | |
| } | |
| public class ComplexBusinessService { | |
| SortAlgorithm sortAlgorithm = new BubbleSortAlgorithm(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ComplexBusinessService { | |
| SortAlgorithm sortAlgorithm;// = new BubbleSortAlgorithm(); | |
| public ComplexBusinessService(SortAlgorithm sortAlgorithm) { | |
| this.sortAlgorithm=sortAlgorithm; | |
| } | |
| } | |
| public class BubbleSortAlgorithm implements SortAlgorithm { | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SortAlgorithm sortAlgorithm = new BubbleSortAlgorithm(); | |
| ComplexBusinessService bussinessService = | |
| new ComplexBusinessService(sortAlgorithm); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <mirror> | |
| <id>UK</id> <!--鏡像的識別ID--> | |
| <name>Central</name> <!--該鏡像的名稱(沒什麼用)--> | |
| <url>http://repo1.maven.org/maven2/</url> <!--該鏡像使用的遠程倉庫--> | |
| <mirrorOf>*</mirrorOf> <!--取代的(遠程)倉庫對象,若填central,則會取代默認的http://repo1.maven.org/maven2--> | |
| <!--上一行用單一星號代表取代所有有程倉庫(假設你有寫N個mirror的話)--> | |
| </mirror> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <mirrors> | |
| <mirror> | |
| <id>UK</id> <!--鏡像的識別ID--> | |
| <name>Central</name> <!--該鏡像的名稱(沒什麼用)--> | |
| <url>http://repo1.maven.org/maven2/</url> <!--該鏡像使用的遠程倉庫--> | |
| <mirrorOf>*</mirrorOf> <!--取代的(遠程)倉庫對象,若填central,則會取代默認的http://repo1.maven.org/maven2--> | |
| <!--上一行用單一星號代表取代所有有程倉庫(假設你有寫N個mirror的話)--> | |
| </mirror> | |
| <mirror> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public interface SortAlgorithm { | |
| public int[] sort(int[] numbers) ; | |
| } |