Core Java Interview Bootcamp: Part 1 | Simarpreet Singh | Skillshare

Playback Speed


  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Core Java Interview Bootcamp: Part 1

teacher avatar Simarpreet Singh, Java Developer at Capgemini

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

5 Lessons (57m)
    • 1. Course Introduction

      0:32
    • 2. Question 1

      8:17
    • 3. Question 2

      11:53
    • 4. Question 3

      13:28
    • 5. Question 4

      23:18
  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

122

Students

2

Projects

About This Class

Hi everyone :)

Having you stop here simply means you are either preparing for a core java interview or want to know the most widely asked questions in the room. This course is intended for you folks, perfectly.

The course basically aims at providing an in-depth explanation to most continuously asked questions through very engaging animated PPTs. Whether it's string, or exceptions, or multi-threading, I have got your back on most asked questions from these topics. The much important thing is the clear and concise clarity in explanations that you will get from this course.

Note:  1. The course is not intended for complete beginners! You need to have at least basic to intermediate knowledge of core java.

2. I will keep on adding brand new most asked questions regularly. So, this course is not just limited to a fixed number of questions!

Rest assured, you will enjoy this awesome Bootcamp with me.

See you in the course...

Over n Out :)

Meet Your Teacher

Teacher Profile Image

Simarpreet Singh

Java Developer at Capgemini

Teacher

Class Ratings

Expectations Met?
  • Exceeded!
    0%
  • Yes
    0%
  • Somewhat
    0%
  • Not really
    0%
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

Transcripts

1. Course Introduction: Hi. My name is similar creasing and welcome to this khoja into Web cam. The main objective off this anti equatorial is to enable you to crack any code of our interview. So the benefits of taking this course living 80 to 90% off the interviews ask for the same portions has covered in this course. I will make you rehearse with all the types of questions which are usually ask in the interview room. 2. Question 1: Hey, guys, welcome to the first question of this tutorial. So our first question is, what's the difference between Jay Dickey, Jari and Give'em? So this is one of the most widely ask oceans in any of the cordial when to use whom? Let's supposed to scenarios. The first scenario is like you have to write the court in your system, and then you have to run their particular or court right. And the second scenario is you don't have to write the court, but you just have good in a particular application. Fine. So what are these two scenarios? The first scenario is you other developer, you first have to write the code to develop better particular application, and after that you have to run that particular application. So there are 21 things you never for scenarios and the no second scenario. You don't have to develop anything. You just have toe rendered particular application. So they recently one thing in that particular scenario. So for the first scenario, work type of environment is needed. Is Judy Gay all right? So job are developing. Kit is Theo environment, which is required for the development of a particular application and to run dirt. Particular application and red particular application is off type jar. It is a George are extension jar file in Java are qualified. And for the second scenario, you just need to render particular door jar extension. Don't jar file right soon. Deck is you just need Java runtime environment. Jari. So here is a user, Jari. And there was a user adjudicating never for scenario. So this waas between jeered Iggy and Gerry. Forgive me, and I will tell you a little bit of detail. So what I told you, Just see the particular slaves toe grab this important concerns. So they're supposed This is Sam and he's a developer. And this is Jim. He's disclaimed. So obviously do more Sam crude level of one of the job application for him. So Sam has to first write the cold and then has to rendered particular application to test If that works Final North. And after that, he has to hand over that particular application to Jim and find the gym has to rendered particular replica here to check if there this working finally system or not. Right? So Sam opens up a system and run this particular variety. Most probably like clips on their beans. And I dont older, good on the Java cold and finally run stared particular court to check if the application created is running fine or not. So here comes a user J. D. K. So Java Development Kids is a needed to provide the environment. Or actually, this is the environment which is required in new system for writing that particular job cold and finally to run their particular Java hold. Okay, so Judy actually contains and development tools for their developer for the Development purpose plus J. R E Javan and demand murmured which is needed to find a leader in what you have just created. All right? No, Sam creates a jar file off the entire or he just returned and that Africa and just hand over it the gym. Now Jim has a jar file. This is you can see the complete wrap up off the court Sam just created for Jim. And now, But there are Tasco. Jim is to just rendered particular jar file and see if it's working Final north. And as I told you for running their jar file, what type of environment is new during in your system is Jerry Java runtime environment. It is needed just to run their joyful. This is nor it will be nor be useful for the development of court Jaros. Nor for I mean it will not serve the purpose water developer. It will just serve the purpose for running your job. Fine. OK, if you water developer, then you have to have Judy game because you will get development tools with just needed to create their particular judgment. So Jim rendered particular jar files and redrants perfectly fine. OK, so here comes a roll of Jari. It was needed to rendered happen. You go dead. I know no one more thing long have to cover What is give'em? So what is JBL actually James stand for Java virtual machine. So let's understand is both developer in client have ah this court Okay develop a hair developed that court So it is obviously present on his system. All the lines of court is present only system and client also has all that particular lines of court only system because he waas 100 at particular jar file by their developer and their particular job offered contains work that contains all the class files and all the class was contains all the court reconsidered so indirectly both development client has started called on their system. And the Francis developer, the loved, that particular court under Judy Kaye and climbed around that particular court on that Jerry. All right. No. What is the purpose of GV in here? So a sectoral, you grt, is needed to a rendered particular application, right? So how internally that application is being run? This is the purpose here to understand GBM. So, Jerry Okay, enjoy bridges pride that run time environment. It provides the environment to rendered application. But internally, what happens is each line of cord in a jar file or each line of code in that particular class valleys interpreted one by one, it is interpreted one weapon. And after the complete interpretation, off all the lines of cold, we get the final output which is shown a number system. And this entire interpretation is Then when another than jbm Java virtual machine. So you can see it It Jerry provides you the environment, the rendered particular application. And internally what happens is in surgery we have JV um death is running each and every line of court so JV amiss, interpreting each line accord in a class file and finally showing us output. So you can say that inside your d k, we have developed rentals, which is beautiful development off over application plus Jerry to run that particular application. Alright. And on the jury, you have this JV um right. So Geum is actually internally is responsible to run that particular application. My interpreting each line accord. So just toe conclude everything. Let's suppose this is Jerry K an inside Judy Kay. We have Jerry bless our development tools development. Does this needed for our developer? So if you're a developer, then you need to have Judy Gay for getting those of development tools. And in surgery, you have give'em right, which is actually responsible for showing you that particular output on your screen. And there you have some library classes these air Force supporting give him in his work, right? So I hope you guard idea accorded particular in this training off this cushion and this is very, very important portion which is being us in almost 80 to 90%. Of course, other interviews. So you need to have a good understanding off all these three times. Jerry, Jerry and Jerry in hope You like this and thank you. 3. Question 2: Hey, guys, welcome to this tutorial. So today's question is, what's the difference between their NP's acquittal? New child and child? C is equal toe new child. So a bit confusing question, and it's immediately asking all of the court of our interviews. So let's understand this. Let's suppose I have a list l like it can be any a realist, and I have stored some random elements in it. X y z b c. Okay, uh, just to make sure that these X y z or every city these are north string Okay, These I mean, any kind off I'm in. Data types can be stored here like it maybe, like contagious or expose maybe bullion type or it may be float or something else, but not a fixed date or time. Okay, so I have a list l maybe some a realist And I have stored some random elements inside this aerialist, and the elements are off Any data. It either don't know it. Maybe in all of the animals, maybe a shrink or all the elements may be off in teacher or all of them. Maybe some fluid or something like that. Fine. And they are their respective in this is a no. I want to get a new element a position do OK. So l don't get an index to very simple the eliminate index to is it? No. The issue is how do I store this? Is there? Should I use spring data time to stores that should I use in degenerated? I pistols that Or should I use bullion type two stores there, Right. I don't know what the store. So since I don't know what is a run time data type off this l Dunkirk index to so I will use object. Fine. So object is a super class in Java that can hold any kind off data type, whether it is string or whether it is Boolean or in leisure or anything. Object is a planet off everything. It can store all of the do that I fine. So in the case, I don't know what is there in time. Traitor. Time off the output. I use object. But in case I knew that it was string then surely I heard use string Variable name equals two l don't get an index to But since I don't know what is the final turn time output. So I use object in case. Now let's understand this example. This is a couple on and they have a daughter know this lady? She has blue eyes and this is a daughter. And she has green eyes. And also she has been more featured off Sharp nose. Okay, so this is a couple where the mother has new ways and the daughter has green eyes as well s a sharp news. This is a programming example of the above scenario. I told you, let's say this is class, Mom. And we have one string variable I color okay, and had a one function show. Right? And last daughter extends Mom, and she also has one common Ah, string. Very even eye color. But she has an eye Calero green. And she has one more extra feature, which is sharp nose. And she also had the same functional showing her all right? No, if I create a new object of doctor like Dr and Jesse was two new daughter. So this is same s child C equals two new child. Fine. There is no issue. This is a very simple statement. And if I do jesse dot show what should? With output. It should be in Darfur. Find So the shoe mattered off. Daughter would be called here. Simple. No brainer. This is called him Buried approach. Fine. No, If I do, Jesse Door features again. Features off. Dr Will be called, which is sharp news and FSC. Jesse don't eye color. Then again, simple All food would be green. Fine. No. See this If I say Mom Maria was two new daughter. This observed this line more Mari equals two new drop it. The same s bearing P equals two new child. Right? So this conservatives also newness up casting now what happens? Series? I'm creating a new objective daughter. It is no being referencing toe failing mom. Right? So this time that child object is referencing toe they wouldn't be on. What happens here is we created a new objective. Daughter Burke, this is being referenced by the more Maria. Okay, so we created an object off child class, but it is being referenced by the patron class. So what happens in this case is whatever I will call any very well or functions, everything will be called off that off period class, right? No, no child class will be called by this because Mom, Maria, if I call Maria Dark shoe or married or eye color, everything. Since Maria has limited access now Marty has only access to the class. Mom, Mother doesn't know work than daughter class has. How do my area knows what the features are there in the class, daughter. It's like how class Mom would know what is in class daughter. But class daughter knows because it is extending from class. Mom, So plans. Daughter knows what is there in class. Mom. All right. So since the class Mom is in a were more extra features out of ill 1,000,000,000 daughter. So there is limited access to class. Mom, she can only call All the features are all the variables, all the functions off class, more Monday. So if I say my adult show, what should the output now in this case show is also will willing Mom and I went over it. And my virtue is also well, billing daughter. Right now Moment surely call the method show off herself. But what happens inside is jbm no also checks for if there is another method off same name in the child last also north. If there is no another method off seem them then the show matter off Mom will be called no issues. As I told you, everything which is being very more miscalled So show is there in month a show mattered. We call of mom glass only. But one more step occurs after this Juvenile checks If there is another method show in the child class And since it is another matter dear in the charge list which is same s mom Plus So the shoe method off giant last will be called here. So the output will be in daughter now if I see Miley and or features you can see there There is no variable features in class Mom Right? But it is available in class torpor. Soemadi has no access to plus doctor, right? What a little sure it will show Combined I matter, right? There is nothing like features in class, Mom. So it will show combined. I mattered Find now if I see Maria or eye color now there is one exception. This is one of the exception. I want to tell you what happens in case off calling variables. It is different from calling functions if there is a function in parent class and there is also a function with the same name in child class with the same thing natures. Surely the method of the child less would be called, which is over them. But what happens in case of variables, even though they're very both with the same name in both parent class and child class, Burke them variable off only parent classical record. Okay, so this is one of the case in this even though we have very well I color, which is president last month and we have seen very well I color, which is also president. Water bird participants is very well off. Parent class will be called here. So in the output with me blue So just toe ever recap here There are only two things to note here. The first thing is when we see beer and P equals two new child which is similar to more Maria equals two new daughter. What happens is now that if less variable is created debt off here in class. But we have created an object off childless. Although we have created an object of Chancellor's There is no access to the child classes because the difference very release off. Last parent and parent has no access to class daughter. But the class daughter has an access to class mom because it is extending class. Mom, if I call any method using the reference very beloved class parent, the method off hate and class will be called first. Okay, If that method name is present in barren class, it will be called without any issues. But if it is not president class Mom But this president, class and daughter then they will be compiled by Metta because glass mom has no access to class daughter Look, if there is a method name which is President Glass Mom But the same matter name is also real billing plus daughter. Then the matter in which is available in class daughter will be called That worry LTD will be called The second point is, this is in the case off very was if we're calling any variable limb using the reference very well off Haren class What happens is if they're very badly missed President class parent then that will be called without an issue. But if it is not here in class, Mom. But if it is, there are not in class and daughter they re compile. I matter because class Mom has no access to class daughter, right? This is like there was no very blame, like features in class, Mom. But it was there in class. Daughter Jamie will check for if it is available in class. Mormon, or since it was not available, chose combined the matter. No. What happens is if it is available in class, Mom if their particular variable amiss, available in class, Mom and the same variables also available in class. Daughter, There's no concept of overriding in case of variables. Okay, In this case, there is no concept. It will not be worried in them. Variable, which is there in class Parent will be called even though the same variable in missed hearing child class. This is the case here, and this is the entire conserve behind this for the case off, child C equals solution. There is nothing complexity. There's a scared forward thing. Anything will be called off that off class daughter only, right? Because the reference were able ism daughter and object clear treatise also torpor 4. Question 3: hi guys. Well, moved to a new to to So today's question is, what is the difference between exceptional letter? So again, this is one of the most widely ask oceans in any coach our interview, and you look into a complete description and completely tale about what exception is and how to prevent an exception from coming. And what actually an error means and how, in what sense and add it is different from an exception. Are they both saying or are the bull completely different when you look atyou ever coming? Ah, slaves. So let's Jember do this. Possible board error and exception. These are the charge glasses off three. Well, glass. We have a super class known as trouble in Java from which all these exceptions classes you may have seen, like Mel Border Exception arithmetical exception, a number former exception. They're numerous exceptions, and these are all being the right from tribal class. All the properties are there in the trouble, and these exception glasses just inherited those properties, which are they're in trouble. So, in case if you are creating your own custom exception, you may have to extend their terrible class and same for the others. Any radicals is already being, I mean, extended from trouble class and aside north you have I mean, ah North. Some of the names like Clooney will. There's an interface. Cereal is able. There's in interviews. Convertible. There's an interface. So three will. It's northern in the face, guys, it's a class. So just be careful if we're being us. Like if trouble is a class or the face. So it's a class. This don't go by the name convention on this to people the border. So yes, both other an exception are being. I mean, there are from trouble glass and there's the super class or all others and exceptions. Basically, every song were three able throws throw keyword in overcoming lessons just to give you a heads up. I mean, what? Actually there isn't relation between or these three. So I just told the border basically, we will just look about into exception and Adam in this trattoria right now. So what exceptions is all right? These are basically some problems that causes your program to crash down Order stops of normally, actually, exceptions are nordea much serious? Tenor editor Berta, uh, programming level. We need to know. I mean, Jack, what? Any exceptions can cause your program toe shut down and how the women you can prevent your program for being getting stopped. So these are basically some problems start can abnormally stop your program. And exceptions have basically occurred due to a programmer's mistake or his negligence. So what I'm saying is like then we have bean. Some some criteria are like some missing lies according to May have returning your program there could have prevented exception from coming, but assume a norm have been a very well writing the program so you can get into an exception. So this is a case while in exception and since, like it isn't, men will mistake as your program and we're human beings. So this can occur on, actually, and as it is a man wheeler and mineral exception, so it's completely recovery will. So it's nor don't a CD s North courtyard in Paris. I'll really serious guys. If you are, you face any other new program then then you cannot recover it. Your program Wilshire don't abnormally, and there's no way to recovered it because errors and north caused by ah men will intervention or any men will let it. Programmers, Nervous moments people under that is basically caused. You do system error or system issues like there was some insufficient memory. New system, your am is not like s for the requirements of your current program. So yeah, these other I mean courses for any other for right time. I just look into exceptions. Um, yeah, this is these are the problems that occurred during the execution of a program. And as I told you, it will actually cause the termination of your program. So again exceptions can occur at compile them. And also during time and again, guys, every talk about exceptions like water. What exceptions commit, compiled them And what computer? Ah, run time in overcoming slides in overcoming lessons. But for right? No, this chapter is basically just put their differences, balloon exceptions and others. So you're exceptions is caused the termination of the program. Just keep in mind in this and this is major new judo program must mistake or negligence. I was looking toe this like in the coming example. Ah, changes can be made to a program, their computer and then exception to come. And so these air also recovery. But that's I told you, this is basically Manuel area so we can recover it and how to recover this. There are basically two ways to prevent an exception from coming. So there are two ways which are using a trike. I spoke there. You may have surely heard in your I mean college lectures or and in your organization you have seen in this year in your project. And you must have used their trinkets just to grief. So this is whenever ah, we toe prevent exception and another is using a throws keyword. But for now, will we just be looking at try catch? So there's a program in which I just want a leader data from a file which is located in London. Andi, what kind of exception can occur at this point? So actually, this is a combined time exception. And what is compiling exception in her name exception? Everything will be covered in with the covered in overcoming lessons. But just for right now this Remember that the liner turned this at least data from off I located rendered and I just want to return data profile and what kind of exception can occur. This exception can be like five minutes have been present in their Cookie Schindler then. So if former compiler is not able to find the file, then surely it will stop every storm, the current execution of the program, sense of the finalists nor president. So what's the needle running the program continuously, and that is of no use. So just to recover from this situation, if a finalist nor president learned innovation, just give the combined later on another file and just continue execution of the program because I mean really reading a file. Gandhi. One of that, a part of this brutal murder native There will be some other critical parts in the program . There may need to be, um, in full food. So if only if you program gets shared, um, just before execution of those are the critical issues. So that could cause some other problems. OK, so just were rendered, you sketch broke. Look, as long we just mentioned filing or formal exception. This is one of the exception which is a compiler. Them exception. And by writing this yet telling compiler dead Okay, we're disorder. There will be an exception. And we're already, and we're getting there. Exceptions. So please just continue over normal through as the execution of the program and just don't stop. We noted. We have some movie may face, some fired or foreign exception, and we're ready for this. And so we will provide a local well and continue the rest of the program. Normally, what local fellas like if in the chance like it is not like the fireman or President Lyndon location, it may be a case there. The file in North present and in decades tell compiler to use a local file, which is president on my current local system and run. The rest of the program normally work addresses, and it's actually Seamus exception. It is a problem that can cause you pull them to share donor or crash. But it is more serious than exception, since they're just not cause man any programmer. This basically a system foid. So since it's a system port, you cannot do anything and you cannot recover it. Unfortunately, so we have to be much more careful for the others. So, for example, like okay, just a brief about this program programs that can occur during execution, a little them and you can cause abnormal domination. And yeah, this is a basic difference due to a lack off system resources. So they may be like some resources there you program there you current Java program may have needed. And you feel to provide that. I mean, you're not actually a beard of their I'm in human or Bill dealing with their system resources. There is not a part of your job where that must a critical part toe. Continue your current execution and yes, there nor trickery will. That's looking toe demo for this. This is a programmer who is like hard calling from 3 to 4 hours continuously, and he's totally shouldered here is not, uh hey has not made any mistake in this program and for any exceptions here already, you strike at your through skiver toe catch, and neither of them were combining exception Bourgain, hay Gerson out of memory. And certainly I was confused. More Candide shoes. So after a hard fork movement, he came toe the resolution there that it was actually insufficient. Jimmy, um Jeevan Stansell job over short memory. It is like the memory in your system. Oh, like we have um so there's also memory and Gibbons also heat member in the system and paper snort like up to the mark, many a few job programmes and many of you are there like ah, system properties can crash certainly. So this was actually been citizen for this. And now in this case, we can actually cedar programmer can no do anything. He is like he has no control on Jeriome. He's a he's just starting bonus and that cord his looking into scored. He's just building his own logic, this new women topical give'em in this mine. So there must be sitting your task for the Severo system. Ernments, who work on upgrading all the systems, provided toe the programmers. So again, programmers not response will to handle this. And as I told you, it's irresponsibly. Do any demonstrators so sorry. Wherever means increase their GBN and, if they have known, increases even shortly them their color time. And then you will see the several rock of Miami again because there's not much space, not much memory available in your system. How can you keep writing er on their land? The lines of cold so this cannot be recovered and they can only correctly. If you are in a program you can operate. Any lines are calling you program that can prevent the center. If it's coming, then that cannot be. I mean, Eric, over. You have to fizzy that it will surely sure down the system shared on your and current running program. So you have to be a heads up before this. This is more critical issue, and this is really a serious issue. And you have two women, first of all, a bleed. All your system. The sources ask your system arguments. Secretive system had been to check it every oh, every bit off your memory, every bit of it. Systems is after the mark on They should not be any problem, including a large number of lines. So actually, this is all of this. Thank you. 5. Question 4: Hi, guys. Welcome to this new territorial. Today's question is more dessert difference between check and inject exception. So in the last two studio we governor difference between added an exception on, we just came across. Some basic I'm a differences more. An exception is in weapon ever is, and you'll see neuter like exception is not on North is not on meth sidious nor treading in error, and exceptions can be handled manually since it is ah ah, it isn't manual intervention by Manuel Letter so it can be recovered. Today we're discuss about the types of exception on discussion is I mean more than 90% of their interest discussion. It's usually us, so you should be well prepared for this Kocian and so exception side of two types. The object exceptions and unchecked exceptions. What I checked exceptions these air those exceptions, which are being checked by the compiler at compile time just before you're in the final program. So I mean, you know, there are two stages in while running a Java program. First you compile and then you run your program so off. Welcome violation. If you get any exceptions writers than those object exceptions these are being checked better compiler. Ah, just before the other in time and water unchained exceptions. These air those exceptions which, when you compile the program are not seen here. Ah, the compiler ignores them. And birth Easa Schoener downturn time. So your program will compile successfully. There would not be any issues where every time you will get these exceptions and jewel get I'm in your program in northern successfully. So this is a basic difference between there and we will look at the program toe, understand this much better. So first, few definitions so checked exceptions said that exceptions which are being checked by the compiler uh, come fight time. Ah, Okay, so this should be handled before compilation of program. So, yes, this is a must for this. If you know that there may be some exceptions in your program there, there will be checked exceptions And that may be true in by the compiler. Compile them. So you should handle them. And you know, I mean, what are techniques to handle these exceptions? Director techniques there are try Cech block. We can use free cash flow in your program or else you can use through ski word. Both Philemon gas your exceptions and they were nor been combined the matter so yes can be handled by using Try catching through ski where and in case you're nor your nor getting good exceptions you are Ah, I mean, you you're not aware there didn't reject exceptions. And if in case there, president your program and surely you will get the compile time era Yeah, where God is a northern CD so you can look up whether you can again you strike s or brackish broke under that particular matter which is through England particular exception and they were told of any problem. So let's take an example. I'm going to take an example under which I'm trying to read a particular file withs located at a particular location. Let's see, work exceptions can occur in this whole program. So let's including a glass example and under publicist rating World Man I am using file and put steam. So basically filing for extreme is basically usedto read a particular file from a particular location. So I'm trying to read a file at Location B and my file a miss my filed or txt. So what exception can be true nerd. This particular line by the compiler. Just think of that, Mark. Maybe the exceptions. So first of all, of one more difference between check in and check exception is stared, checked exceptions and those, they're like, compile a nose can be present in your program in your current program. So the con violent or send it I mean, it intimidates you, like before final rin running off your program that these air exceptions you should handle there. So compiling Northeast came with exceptions and unchecked. And those exceptions which compilers north of it over there, There, there these maybe some exceptions there can be thrown. Ah, while in the program. So going toe this line f i s is called a new file input stream. So the exceptions are exceptional. This line, maybe like that particular fireman, or be present hurt that particular location, be it maybe in some other dr like Dr the or drives you whatever drive your creator in your system or in the case that my file may not have yet been created in your system, so exception can be filed nor phone exception being thrown by the compiler compartment. So, just after you compile your program, you must see this exception like file or foreign exception, which is unhindered. So compile is telling you to handle this exception. I'm just telling you, this may be the case here. So surely this is a case here. You have Pandelis and we look at how to handle this upper in the next light. No, let's in the Yeah, another portion of this Look at this file loop and under. Why? Look, I'm writing this. We have declared Interior K and K is equal f A s store treat. So weren't f I s Don't read well, Louise, every restaurant read will read the entire contents of the file My file And it will come to all the characters in your file and all the characters in your file will be stolen in the jerky. So it will be a numeric value, for example. Then card content off your file. My file. Ah, some step 200 characters, so 100 characterised will be stored in the jerky and want this entire vile open do. Is it will? I will try to sprint. All the characters of a child in your file can't get it with zeal till then began. I'm imprint all the characters and if it goes minus wants, is minus one. It's not of added value for encounter, so we will get out of this look. So basically, year, this program is doing that only and did method off. I'm in violent put steam, miss. It also throws one check exception. Input. Input are born Exception. Ire exception. So you don't have to go into much detail like what Ira exception is doing cares. You just have to be aware that this line it through exception as last night. FAA store clothes. So there is also in checked exception being thrown here. File input stream, good clothes, the clothes method. Ah, it is basically a cure you guys, so don't get bored here. The red metal, no file import seen the clothes method of violent extreme. Both rose higher exception. So this is basically a theoretical part. We can all do much so in the bill through exceptions, so you have to use strike Etch. We are drag it for a while and dry catch for, or a fire store clothes and also try catch for their off filing put steam b slash my fight off the XY. So these are They're basically exceptions being thrown by this particular lines. So compilers, compiler? No, sir. These may be the exception strewn. So you have to check them. No, If I run this program without, I mean using try captured through Skipper, what may be the output unhindered exception time file, nor for an exception. So this exception came for the line F i s is a called a new file import stream B slash my file or txt. Where this exception is telling is there may be like that my finalist North President file location be. So you should be well prepared for this. If this is so what? I'm innovative. But so work the compile issue of Look at it. If they're my fellow is known there, you should give some another file to the combine disorder. It can continue the rest of the program. So this is the exception. Fine or foreign exception. There can be the case here and next next Two exceptions that I exceptions The first i xx tunis for the raid method of filing poor seem the read method always true. I exception. And the next I exception is for the F I s torque close matter that Louis mattered will also through the air I exception input, output exception. So you have to handle this. These are basically theoretical parts. So you have to look into this. No. How can we heard the lose exception? First women see like ah, by using through Skipper. This is the entire the same program we just saw her dear. And how can we? Hander exception is by using through ski word. So which Met Hurt contains over in that logic here, the public's 30 Goldman. This is the method, which is containing of logic, right? So the truth ski even is being used by the dark method under which we have retained a particular logic which may throw their kind of some exceptions, turned up a Blix 30 board. But which is a method Viet writing a logic off reading a particular file and there are some sentences, some statements which made through exception. So we will use through a skewered with that particular mattered. And what exception on what we're writing is throws are exception, so it reliable it will catch the exceptions which may be thrown by this program and that compiler, Well, I'm incompatible North Be able to see that compiler will see their your I'm in catching their exceptions so it will not born you. Basically, Compiler tries to help you by warning there These are the exceptions which may be thrown at a little strange is if you do lead to a file if it is not president of that particular location, so be prepared well before that. So we use through I exception another that the question, you may ask is why I am not writing throws file, not foreign exception. Why? I'm just writing I exceptions is to give you an alligator. I exception comes into much upper hierarchy, then file, Nor for an exception. There are hierarchies like Firelord exception is a my own lower level, and I exception. So if I'm writing, I exceptions, all exceptions on that I exceptions May will be automatically being catch by their compile it so we don't need to right there. So we just began just right. I exception and file north own exception will be taken care of on in case I mean you are, I mean nor born to get confused. Then you can also write throws fine or foreign exception Coma. I exception. You can write down all the exceptions which you may feel maybe I mean being thrown by the compile it so you can hurt all exception. I just rode the exception IAC section because I know this is a most high level exception there can be thrown by that this entire program. So if I'm if there is chance or any other exceptions which may be of lower, I'm in a priority, then that will be taken care or committed, Lee. So this is a case by using throws, fever, biting through a skipper. You are just telling Compile it. Er yes, I'm well prepared, so just don't give any compiling matters. I know that these may be the exceptions and I'm just catching them. So don't worry for this. No, the next murder is using right cash flow. Our game a scene program. I have just omitted a few leads a form because it is all know you straighten out here. Just the main lodge you want to see here. So then that same program, I will know you strike it. So first, try catches for the that particular line fr Yes. Is it called a new file? A report stream? Just no, don't high. I am writing this under trite. I'm writing the mind at logic. The basic logic off the program we had. Exception maybe. I mean thrown by the compiler is corn under Try block Under try. I'm writing a faces. 1/4 new filing put stream b slash my filed or p XY So this particular line was throwing the exception, so I just kept it under Try catch. No, it's under gas Block. I mentioned that particular exception which will be thrown by this particular line So I'd write down file nor formed exception under cash flow. And I also write their particular statement off, Given for less nor president. It means that, you know, as a programmer, you know there. If this exception is thrown, then it means given finalist nor present. So compiler, industrial dead. You know this exception and it will know through any particle exception No, there is no more. One more. Two more exceptions under via Loop and for their effort yesterday close. So for red method and foreclose matter both exceptions being thrown out. Iraq's action several just use weren't right catch block again and will cover the entire logic under this single try catch. So again, the same thing. But now, under Castro, I am telling the competitors. Yes, I know it will be higher exception. Uh, I will be handling this or don't try toe. I mean, don't give me any combining Maris. Just just end up programs smoothly. I don't want any interruptions right now, so you revel. Two women handle these or these exceptions perfectly. No. What are some other type of exceptions? Checked exceptions as school exception is a checked exception. So whenever you're writing nes school grading guys, fine. But you have to cover it under. Try Cech Blow because they need maybe some time in issues while fighting that particular recorder, adding that particular records interview Chavez. So there occurs a mescal exceptions and class nor foreign exception. This is also one of the exception you have. You may have heard of this, but we're not going to retail on this. These are just examples. So whenever you're telling your interview about differences were doing, check in and unchecked exceptions, please do mentioned examples. We will have a more invocation. Target exception. So a school exception class not formed Exception in location. Dollar exception if you're noticing them. So these are the Czech exceptions, which are being checked by the compiler and compare them. So this first for the chequered exceptions. Now we look into unchecked exceptions, so unchecked exceptions are basically nor checked by the compiler. Wrecked compiled them, but rhetoric runtime. So first of all, these are exceptions which, in nor being checked, putting a piloted compiling, compiling this north of Vero like you are writing, you may be writing some high level logic and compilers, nor I've been able to read your mind work typology you're trying to write in their particular lodging, maybe throwing some exception. So, like you may be writing, you customize and I custom I scored and direct. Thanks. Geingob compilers North Laredo Combat It is just a machine, and you may be writing some court from your mind, and that may be thanks. Um, exception. Like the real time example through different shit. Between this check and uncheck exceptions, for example, you're going for your call examinations on just you're just trying to leave your home. You're ready to relieve your home for your school? Yes. Your mother came to you and your mother tells you did Have you taken your pen? Haven't taken your geometry box. Have you taken your admit card for the examination? Hold. So what are these? These are the checked exceptions being thrown by your mother. Some other research compiler, she says, warning you if you have taken your Ben, do you have your whole ticket? So these other things. So these are the things which waas I'm in which a mother usually knows. These are common things. I mean, keeping you remember about your ah, Ben about your whole record. So these were the basic I mean, exceptions which may be thrown which may be taken care on. So your mother wants you about that, and you just take it off that you tell your mother. Yeah, I know. I have one extra pen. I had that made cards, so don't worry. So electrical with examination, all this was a case for checked exception and one were capable and checked exceptions. You will be going to the examination and like, ah, there will be some bomb plussed in the examination hold. They can accustomed bomb blast in the examination. Or but how will your mother knows that there will be some bomb blast in their examination hole. So this is unchecked exception when you compile it us. No information. What is going to be in the future or something off high level? It is not. I mean, in the knowledge of that compiler Hubble turned their tell you of ordered particle exception. You will have to face their exceptional turned them. And after that, you have to correct it. You can order. I mean, get a pride information that compiler, and then you is old them and you get the successful friend time program, execution. So for unchecked, you will get them it around time. And then you have to correct them in your program for the successful execution. So this was a case area dame example Just to make the things moved here coming back to this . So yeah, it is not a compiled a matter Northern nonviolent exceptions or too low born course and income violation at so Ah, again, lucky. So bomb blasts actual school. Sorry for this, but I'm escaping their game with them. Born blessing your school and how you have with your mother knows there may be some time in these type of accident, so it will won't cause any compilation error. There won't be any combination you'll compound successfully. It means you will leave your house successfully for the school. So But how is this basically? Because how? Inject exceptions are good. The circus. True. Too bad data provided by the user on Don't compare it with the bomb blast. That was another. I'm an example just to differentiate a bit. But in real time, in the programming language Free talk. This is basically a custom Could bear data provider. But I use it. For example. You're dividing a particular number by zero here, and you want a particular our food. So compile every north or any exception for this. Are you writing any wrong statements? No. You're writing Kerekes treatments like you are dividing. Then your department and Ba 0 10 is a valued member that divides symbol Isabella Temple, and zero is a valid number. So compiler doesn't know. I mean, come by. Let us know knowledge about what you're trying to do, but you're trying to get you the devastation for this. So compiler has no idea about this. This will be a McWhorter that on time on the So let's take an example again. That example just told you Example. Different. Taking number one is colluding number to a school zero. So I'm storing their divide that desert over the work in Antigua reserved and I'm just spending dessert so again it would compile successfully. There is no error in writing this. Everything is perfectly fine. Oh, and compile. It has no idea what you're trying to do it so it will dry and fine. It will compile fine, but it will, through arithmetic exception the course. My tent divided by zero and won't give me any. Oh, any concrete output. So it is an exception in Java language. It is an arithmetic exception that you are no dividing them correctly. But this filing for seem it ended knows if you are writing, filing put, seem you must be writing the particular location and it may be north, the fireman or president your particular location 100 possess keys here, but logic behind this the logic is strong here. Number one. Divide repair number two. It's not a correct logic here, burnt compile addressing why D about it. Compiler doesn't know about this, so it just the compiler just checks about. Thus the syntax of the program disk. Correct. Then it will not through any combined they matter. But if we taste thematically wrong, the logic is wrong. Then it will be to Northern times we're getting this. Turned the exception smarter? The example. So no bordering the Phoenix again. So, for example, like you're creating an object like a student as physical TUNEL you're getting. But in the entire program, you detain them and created a new appeared. You didn't assign any new object to that particular ah, class name soon that came then, maybe in l point exception. For example, Your York like animal Jack is a cardinal, but you forgot to write animal characters a call to new animal in their type program. They would normally compiled America where there would be an unchecked exception that would be returned time exception, and it would be there that will be in the port, exception your cactus nor pointing to anything in the memory so that that will be the exception here. Another is area index out of bounds exception, for example, like I mean you're declaring an area of size four, but you're trying to print an element index five. So compiling in northern exception, come by letters. New idea about it. Compile FC's there you are writing, but every Centex correctly. So you're the intestine, Texas, actually correct. But it will be thrown into runtime because your logic is strong number. Former exception is again the same thing. So this was all about, like of the checked in and checked exceptions. Thank you.