#82 Ducking Exception using throws in Java

Поділитися
Вставка
  • Опубліковано 15 гру 2024

КОМЕНТАРІ • 31

  • @devwithsmile
    @devwithsmile 11 днів тому +1

    This series got me job last time. And now I am here again when I want to switch , revising . Thank you so much sir for such quality content.

  • @harsh-ox9gy
    @harsh-ox9gy Рік тому +15

    best java tutorial series!

  • @ChandraSm1310
    @ChandraSm1310 21 день тому

    Every java developer must watch this exception series from Mr Naveen ,the Alien, who teaches java at root level❤😊

  • @malinigowda5586
    @malinigowda5586 9 місяців тому +1

    best java tutorial series! Thank you so much Navin

  • @suneethamudragada
    @suneethamudragada 3 місяці тому

    Very usefull for us in this video I learned the throws very easily iam very confusing in my institution while explaining about this. They are not explained just they said keep throws keyword now I got clarity about this thank you very much .

  • @dhivyalakshmi1255
    @dhivyalakshmi1255 24 дні тому

    Thank you its very useful to understands throws keyword

  • @Rhanjag
    @Rhanjag 4 місяці тому

    Hi Naveen, it's not thought in the series for Class.forName. Can you add a series here? It would be really helpful to us.

  • @mdmusharraf7045
    @mdmusharraf7045 2 місяці тому +1

    come here after wasting 1 hr in paid batch . Nice explanation 🧡💛💛

  • @parthisanjay3252
    @parthisanjay3252 8 місяців тому

    public void b( ){
    try{
    c( );
    d( );
    }
    catch( ){
    }
    in the above case b( ) method called both methods c( ) and d( ) with try block. If c( ) throws exception means execution will jumps to catch block so d( ) will not execute right.
    }

    • @adarshveerabathini8550
      @adarshveerabathini8550 8 місяців тому

      It will jump to catch block to handle the exception ...then the execution will continue and d() will also be executed

    • @parthisanjay3252
      @parthisanjay3252 8 місяців тому

      @@adarshveerabathini8550 No bro, i tried d( ) will not execute

    • @adarshveerabathini8550
      @adarshveerabathini8550 8 місяців тому

      If u want the d() method to be executed u need to place it in finally block

    • @adarshveerabathini8550
      @adarshveerabathini8550 8 місяців тому

      Once an exception is raised it will directly jumps to catch block by skipping all the remaining lines so....may be it will skip d()

  • @bipinkori4060
    @bipinkori4060 Рік тому

    My main method throws AgeNotFoundException and JVM returns the error.
    why this soo??

  • @Giri14_18
    @Giri14_18 Рік тому +1

    sir the lectures are just awesome .
    sir are you from south india ? telugu states ?

  • @LifeAt1004_
    @LifeAt1004_ 4 місяці тому

    Can Someone tell what is wrong with my code
    public class ThrowsKeyword {
    public static void show () throws ClassNotFoundException( ) {
    Class.forName(ThrowKeyword);
    }
    public static void main(String[] args) {

    try {show();}
    catch(ClassNotFoundException ce){
    System.out.println("Class not found");
    }
    }
    }

    • @dudisaicharan
      @dudisaicharan 4 місяці тому

      public class ThrowsKeyword {
      public static void show () throws ClassNotFoundException
      {
      Class.forName("ThrowKeyword");
      }
      public static void main(String[] args) {

      try {
      show();
      }
      catch(ClassNotFoundException ce){
      System.out.println("Class not found");
      }
      }
      }
      just small syntax error ,every thing looks fine with u.
      Error->class.forname(" ")
      throws ClassNotFoundException (its a class not a method,dont use brackets)

  • @bipinkori4060
    @bipinkori4060 Рік тому +4

    package ExceptionPractise;
    public class Voting {
    public static void vote(int age) throws AgeNotFoundException {
    if(age>18){
    System.out.println("Eligible for voting");
    }
    else
    throw new AgeNotFoundException("Not elegible");
    }

    public static void main(String[] args) throws AgeNotFoundException{
    vote(10);
    }//Main ends here
    }//class ends here

  • @jayanthipenugonda7274
    @jayanthipenugonda7274 Рік тому

    I remember that Class.forName was seen previously in one of the videos of this series. If anyone knows please tell me.

    • @virendersinghnegi5009
      @virendersinghnegi5009 4 місяці тому

      I don't think so he taught us this in the past.

    • @tusharburman2831
      @tusharburman2831 4 місяці тому +1

      no i guess class,forName he didnt taught us in the past videos

  • @jackfrost8969
    @jackfrost8969 5 місяців тому +1

    you have not taught static {} code up until now

  • @ooogabooga5111
    @ooogabooga5111 7 місяців тому

    but this only works for checked exceptions, what if I want to force unchecked exceptions to be handled ?

  • @indiandeveloper8614
    @indiandeveloper8614 Рік тому +4

    In Exception you are going so fast

    • @HN-bn6vv
      @HN-bn6vv Рік тому +3

      Yes, but you can adjust speed 😀

  • @Nikitaaaaa17
    @Nikitaaaaa17 4 місяці тому

    Accenture pdf

  • @kochi_02_abhinavtongale73
    @kochi_02_abhinavtongale73 Рік тому +1

    👍👍👍👍

  • @ManishKumar-zt5sk
    @ManishKumar-zt5sk 7 місяців тому +2

    Taklusko