Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class testing_second {
- private String string;
- private Object NullPointerException;
- public String getString() {
- return this.string;
- }
- public void setString(String string) {
- this.string = string;
- }
- public void mostCommonChar(){
- try{
- if (getString()!=null){
- char i= 't';
- System.out.println("Testing Try");
- }
- } catch (Exception e) {
- System.out.println("Trying Exception");
- }
- }
- public static void main(String args[]){
- testing_second test1 = new testing_second();
- test1.setString("");
- test1.mostCommonChar();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement