forked from UiPath/Community.Activities
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
3827d5c
commit 9946830
Showing
7 changed files
with
539 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Binary file not shown.
17 changes: 17 additions & 0 deletions
17
Activities/Java/TestProgram/src/uipath/java/test/Cons.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package uipath.java.test; | ||
|
||
public class Cons { | ||
String[] arr; | ||
|
||
public Cons(String[] cons) {} | ||
|
||
public Cons(String cons) {} | ||
|
||
public Cons(int[] cons) {} | ||
|
||
public Cons(float[] cons) {} | ||
|
||
public static void Write(String[] args) { | ||
System.out.println(args.length); | ||
} | ||
} |
96 changes: 96 additions & 0 deletions
96
Activities/Java/TestProgram/src/uipath/java/test/GenericMethods.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
package uipath.java.test; | ||
|
||
public class GenericMethods { | ||
public String message; | ||
String[] arr; | ||
|
||
public GenericMethods() { | ||
System.out.println("Constructor without parameters"); | ||
} | ||
|
||
public GenericMethods(String[] cons) { | ||
System.out.println("Constructor with String[]"); | ||
} | ||
|
||
public GenericMethods(String p1, String p2) { | ||
System.out.println("Constructor with String and String"); | ||
} | ||
|
||
public GenericMethods(String cons) { | ||
System.out.println("Constructor with String"); | ||
} | ||
|
||
public GenericMethods(int[] cons) { | ||
System.out.println("Constructor with int[]"); | ||
} | ||
|
||
public static void Write(String[] args) { | ||
System.out.println("Static method with String[]"); | ||
if (args!=null) { | ||
System.out.println(args.length); | ||
} | ||
} | ||
|
||
public static void Write(String args) { | ||
System.out.println("Static method with String"); | ||
System.out.println(args); | ||
} | ||
|
||
public static void Write(int args) { | ||
System.out.println("Static method with int"); | ||
System.out.println(args); | ||
} | ||
|
||
public static void Write(boolean args) { | ||
System.out.println("Static method with boolean"); | ||
System.out.println(args); | ||
} | ||
|
||
public static void Write(float args) { | ||
System.out.println("Static method with float"); | ||
System.out.println(args); | ||
} | ||
|
||
public void WriteObj(String[] args) { | ||
System.out.println("Instance method with String[]"); | ||
System.out.println(args); | ||
} | ||
|
||
public void WriteObj(String args) { | ||
System.out.println("Instance method with String"); | ||
System.out.println(args); | ||
} | ||
|
||
public void WriteObj(float args) { | ||
System.out.println("Instance method with float"); | ||
System.out.println(args); | ||
} | ||
|
||
public <T extends Object> T GenericsExtObj(Object a) { | ||
message = "Generic method with Object " + a; | ||
return (T) ("Generic method with Object " + a); | ||
} | ||
|
||
public <T extends String> Object GenericsExtString(T a) { | ||
message = "Generic method " + a; | ||
return "Generic method: " + a; | ||
} | ||
|
||
public void GenericsS(String a) { | ||
message = "Method that is named Generics " + a; | ||
System.out.println("Method that is named Generics"); | ||
} | ||
|
||
public <T> T GenericsR(T a) { | ||
message = "Generic method with return " + a; | ||
System.out.println("Generic method with return"); | ||
System.out.println(a); | ||
return a; | ||
} | ||
|
||
public void finalize() throws Throwable{ | ||
System.out.println("Object is destroyed by the Garbage Collector"); | ||
} | ||
|
||
public static void foo(){} | ||
} |
13 changes: 13 additions & 0 deletions
13
Activities/Java/TestProgram/src/uipath/java/test/GenericsType.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package uipath.java.test; | ||
|
||
public class GenericsType<T> { | ||
private T t; | ||
|
||
public T get() { | ||
return this.t; | ||
} | ||
|
||
public void set(T t1) { | ||
this.t = t1; | ||
} | ||
} |
Oops, something went wrong.