JaVa Help...!

jaycharm

Active member
  • Mar 6, 2016
    566
    79
    28
    Need help From A Java Expert....!:)

    පුළුවන් නම් මචන්ලා Java වල Try ..Catch ගැන
    පොඩ්ඩක් පැහැදිලි කරලා දෙන්නකෝ....:D

    big Help:)
     

    Yahapala_Naya

    Member
    Apr 10, 2015
    2,223
    180
    0
    ගෙදර
    Error handling. exception එකක් පැන්නම terminate වෙන්න නොදී alternative actions ගන්න තමයි තියෙන්නේ.
    *wouldn't call myself as an expert though*

    SomeClass obj = getObj();
    obj.executeSomething();


    SomeClass getObj(){
    return null;
    }

    huka

    SomeClass obj = getObj();
    try{
    obj.executeSomething();
    }catch(NullPointerException e){
    e.printStacktrace();
    }
    finally{
    sout("here!")
    }
    stacktrace
    here!
     
    Last edited:

    jaycharm

    Active member
  • Mar 6, 2016
    566
    79
    28
    Error handling. exception එකක් පැන්නම terminate වෙන්න නොදී alternative actions ගන්න තමයි තියෙන්නේ.
    *wouldn't call myself as an expert though*

    SomeClass obj = getObj();
    obj.executeSomething();


    SomeClass getObj(){
    return null;
    }

    huka

    SomeClass obj = getObj();
    try{
    obj.executeSomething();
    }catch(NullPointerException e){
    e.printStacktrace();
    }
    finally{
    sout("here!")
    }
    stacktrace
    here!




    මට පොඩ්ඩක් පැහැදිලි මදි .....But Thanks For Your Valuable Support :)