Advertisement
Guest User

Untitled

a guest
Jan 24th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. public class testing_second {
  2. private String string;
  3. private Object NullPointerException;
  4.  
  5. public String getString() {
  6. return this.string;
  7. }
  8.  
  9. public void setString(String string) {
  10. this.string = string;
  11. }
  12.  
  13. public void mostCommonChar(){
  14. try{
  15. if (getString()!=null){
  16. char i= 't';
  17. System.out.println("Testing Try");
  18. }
  19.  
  20. } catch (Exception e) {
  21. System.out.println("Trying Exception");
  22. }
  23.  
  24. }
  25. public static void main(String args[]){
  26. testing_second test1 = new testing_second();
  27. test1.setString("");
  28. test1.mostCommonChar();
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement