Created
May 21, 2017 17:05
-
-
Save peter279k/a4b87ec1a41c2e5634b4822a6e1123bb to your computer and use it in GitHub Desktop.
TQC+ 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
class JPA01 { | |
public static int add(int num1, int num2) { | |
return num1 + num2; | |
} | |
public static double add(double num1, double num2) { | |
return num1 + num2; | |
} | |
public static String add(String str1, String str2) { | |
return str1 + str2; | |
} | |
public static void main (String[] args) { | |
int i = add(2, 3); | |
double d = add(5.2, 4.3); | |
String s = add("I love ", "Java!!"); | |
System.out.println("Adding two integers:2,3"); | |
System.out.println("Adding two doubles:5.2,4.3"); | |
System.out.println("Adding two strings: I love ,Java"); | |
System.out.printf("%d %f %s %n", i, d, s); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment