Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyClass{
- public void printText(String text){
- System.out.println(text);
- }
- public void writeText(String text1,String text2){
- System.out.println(text1);
- System.out.println(text2);
- }
- public int sum(int value1,int value2){
- return value1+value2;
- }
- public String concat(String value1,String value2)
- throws IllegalArgumentException{
- if(value1==null){
- throw new IllegalArgumentException("value1 is null");
- }
- if(value2==null){
- throw new IllegalArgumentException("value2 is null");
- }
- return value1+value2;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement