Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. public class MyClass{
  2. public void printText(String text){
  3. System.out.println(text);
  4. }
  5.  
  6. public void writeText(String text1,String text2){
  7. System.out.println(text1);
  8. System.out.println(text2);
  9. }
  10.  
  11. public int sum(int value1,int value2){
  12. return value1+value2;
  13. }
  14.  
  15. public String concat(String value1,String value2)
  16. throws IllegalArgumentException{
  17. if(value1==null){
  18. throw new IllegalArgumentException("value1 is null");
  19. }
  20. if(value2==null){
  21. throw new IllegalArgumentException("value2 is null");
  22. }
  23.  
  24. return value1+value2;
  25.  
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement