19. Exception Handling in Java with Examples
Вставка
- Опубліковано 8 чер 2024
- ➡️ Notes link: Shared in the Member Community Post (If you are Member of this channel, then pls check the Member community post, i have shared the Notes link there)
➡️ Join this channel to get access to member only perks:
/ @conceptandcoding
Topics which i have covered:
- What is Exception
- Exception Hierarchy
- Uncheck / Runtime Exception
- Checked / CompileTime Exception
- How to handle the Exception properly (try, catch, finally, throw, throws)
- Creating User-Defined Exception class
- Advantages of Exception Handling
- Disadvantage of Exception Handling
Chapters:
00:00 - Introduction
00:52 - What is Exception
07:26 - Exception Hierarchy
15:48 - Uncheck / Runtime Exception
22:46 - Checked / CompileTime Exception
36:34 - Handle the Exception(try, catch, finally, throw, throws)
58:42 - Creating User-Defined Exception class
01:01:28 - Advantages of Exception Handling
01:10:17 - Disadvantage of Exception Handling
#java #softwareengineer
we cannot classify into checked and unchecked because its an error but we can say its unchecked bcz it only detected at the runtime ...
Your Explanation is Very Clear as well as in Depth. [Please keep on teaching in Depth.] Thank You Shrayansh Jain.
Thank you
Hi Shreyansh, can you suggest some problem lists or assignments which we can practice on our own?
Thanks shreyansh for great explanation
Great Explanation !
Hey Shrayansh, do the throws keyword after the method all the way upto main() also not break the flow of program??
Hi sir I have a doubt in flyweight pattern like in robot eg we are creating only two object one for human type and other for robotic type as they are cached , their extrinsic value is their coordinates now suppose we have created human type robot and set is coordinate (0,0) and now again we have created another human type robot this time we will get same object which we created before from cache and set it's new coordinate (1,1)
Wouldn't it create a problem becoz coordinate of first object is changed from 0,0 to 1,1 and now the robot from 0,0 will display at 1,1
Can u please help me to solve this🙏
Akshay Saini in javascript and shrayansh Jain in java both are amazing 🚀🚀
Thanks a lot buddy
Hii sir can we get any practice problems which is at the industry level
Can you add video in stream API in java also i think that is missing in your playlist
It's next video buddy
Hi Sir, Please make a video on Exception Handling during Inheritance.
Where is community section ??
@Concept && Coding
thankyou!!!
Multithreading and concurrency challenges such as ListenableFuture use cases and Future and semaphores and other locking mechanisms in depth ..please Sir
Operators and control flow statement left, after that, collections and multhreading going to start.
This week planning to cover operators and control flow statement both.
In case of big applications which are deployed in servers, if runtime exception occurs..which is not handled, will the entire application stops?
No not entirely application, that particular request will fail only.
@@ConceptandCoding But if incase for some logic in application out of memory error occured , then the application server will shut down right ??
What is type of user defined exception if extended from Exception class , checked or unchecked?
ack of the question
@@ConceptandCoding ?
@@sagarsingh-wb8ou In Java, if a user-defined exception class extends the Exception class, it is considered a checked exception.
at compile time its checked
sir where u put the notes.....?
pls share the link
Pls check the description section buddy
Bro can you please cover multithreading, collections and streams
After one more video (control flow statements) i am about to start collections, multi threading unit test cases
@@ConceptandCoding streams also if possible
@@darliy647 it will come under collections
@@ConceptandCoding love you bro 😀
Hi sir I have asked this question previously plz reply sir
In command pattern we have an invoker, but the client can directly use command and pass the receiver to command there is still lose coupling between client and command.
Invoker can only be used for undo operation if we don't want to have undo operation then I think there is no need of invoker.
And the uml that I have seen client doesn't have HAS-A relationship with invoker
No, if client can directly give Command, then it has tight couple with command class.
If suppose any command giving process change, client has to make the changes too.
That's the last thing which we wanted (i e to make client changes).
That's why invoker is added, it's just an abstraction layer for client, so that in future any thing changes it will lead to change in 1 place i.e invoker, bcoz you can have multiple clients but invoker class would be 1.
Hope that clarifies
@@ConceptandCoding sir can u plz give me any example of how command giving process change effects client, in chat gpt i have searched it says we can use command pattern without invoker for simple design
@@ConceptandCoding sir please reply, i am stucked in this pattern🥹
@@yuvhrajverma9665 Yuvhraj, then without invoker it won't be considered as Command pattern, and definitely you can solve the problem without invoker or even without using any design pattern, usage of design pattern is not mandatory.
Consider very simple example: let's say i changed the command method name from "switchOnAC" to "turnOnAC" , will this impact client? Yes , client has to change the name too, what if you have 1000s of clients, will you change all?
If you have mediator like invoker, you have to change only at invoker and clients remain un impacted
@@ConceptandCoding sir and last question 🥹 in uml why there is no HAS-A relationship between client and invoker as client has invoker reference
Error is unchecked exception, as it's throws error during runtime only.
Right
I tried couple of times to join membership But my payment got failed. Can you please help me on this
Hi, generally payment and all is youtube feature, could you pls msg youtube support service, they might be able to help you buddy
No bro not practicing ,how to practice pls tell that also😢
Bhaiya got paytm offer.. thnku so much
Very congratulations buddy 👏🥳
Hello brother,
Are you also going to start spring & spring boot series, as it will help a lot and one can learn everything starting from java to spring boot.
Thank you for these videos.
Yes I am planning to
if you had provided notes, it would have been the best course..i think it would be helpful since you put these videos for members only.
added the notes link in the description, and here too notebook.zohopublic.in/public/notes/u3i1se54e2f3438a84f42bec26cf3336a5226
sorry missed to add that previously.
@@ConceptandCoding i dont know you added to remaining videos, if not, plz try to add and correct me if i am wrong
Hey hi, Where can find the notebook link?
I have shared in the description section
@@ConceptandCoding hey , i like the way you teach. Thanks for making this playlist.
I cannot see the link in description for this video and few other videos as well.
Could you please check.
@@HemanthKumarNandigama ack, i will check and add
@@ConceptandCoding Thanks for helping
@@ConceptandCoding any update when you will be adding the notes. It would be very helpful in revising the concepts. Thanks in advance.
try{ method1();} finally{} lets say method1() throws runtime exception and there's no catch block to catch exception. will finally block get executed. I think program will stop abruptly and finally block will not get executed.
Finally block will get executed.
But do try it out.
@@ConceptandCoding for unchecked, no catch block is needed and finally executes before program ends abruptly. for checked, throws is mandatory both in exception thrown method and from called method, if there's no catch.
bhai your videos are explained in detail but you are not using any editor for the example of the topic..this does not boost the confidence of the viewer...please make videos in which you do coding also with the concept.
Sure
@@ConceptandCoding thanks bhai...milte hn sham ko..topmate pe scheduled h meeting 9:30 ki 😄
font of code is very very small
sorry for that
Bhai sahab apne pure video me Arithmetic ko Arth-matic bol bol ke na kan ke gaan faad di...
:) yes I am working on my pronunciation. Thanks for pointing out. I will take care of it in future.