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 .
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. }
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"); } } }
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)
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
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.
best java tutorial series!
Every java developer must watch this exception series from Mr Naveen ,the Alien, who teaches java at root level❤😊
best java tutorial series! Thank you so much Navin
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 .
Thank you its very useful to understands throws keyword
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.
come here after wasting 1 hr in paid batch . Nice explanation 🧡💛💛
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.
}
It will jump to catch block to handle the exception ...then the execution will continue and d() will also be executed
@@adarshveerabathini8550 No bro, i tried d( ) will not execute
If u want the d() method to be executed u need to place it in finally block
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()
My main method throws AgeNotFoundException and JVM returns the error.
why this soo??
sir the lectures are just awesome .
sir are you from south india ? telugu states ?
yes,he has reddy in his name
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");
}
}
}
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)
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
I remember that Class.forName was seen previously in one of the videos of this series. If anyone knows please tell me.
I don't think so he taught us this in the past.
no i guess class,forName he didnt taught us in the past videos
you have not taught static {} code up until now
but this only works for checked exceptions, what if I want to force unchecked exceptions to be handled ?
In Exception you are going so fast
Yes, but you can adjust speed 😀
Accenture pdf
👍👍👍👍
Taklusko
bro didn't hesitate
loll , hilarious