Automation Testing Interview Question on Exception Handling | Try Catch Block | SoftwareTestingbyMKT

preview_player
Показать описание

Please fill out the above form to join any course of mine with a discount
You can also call us at +91 8009900785

Join this channel to get access to the perks:
Some important java questions for Interviews:
Java Interview Question
1 Explain what happens in complication and interpretation
2 How java internally works
3 how to calculate the range of each datatype?
4 Can I have a size of datatype in bits and bytes? True or false?
5 What is the use of the super keyword?
6 Why do you use try and catch?
7 What is the default value of the boolean data type in the global variable?
8 Explain what is public static void main?
9 Explain method overloading?
10 Explain method overriding?
11 What ae the rules of method overriding ?
12 can you override static method?
13 Which company own java?
14 Why java is called as platform specific?
15 What are literals?
16 What are the types of tokens in java?
17 can you override the constructor?
18 name some Java Keywords?
19 In case of multiple if block statements how many maximum if blocks may get printed?
20 What are local and global variables?
21 Where do we use the final keyword?
22 Name some string functions?
23 Can you overload static method?
24 what is the difference between static and nonstatic
25 Explain JVM memory?
26 Explain SIB and IIB?
27 What is method overloading?
28 What is method overriding?
29 Can you overload non static method?
30 Can you overload the constructor?
31 Does the queue allow duplicate value?
32 Why do you use throw and throws
33 What are the types of inheritance?
34 For each try it is required to have catch block?
35 What is Abstract class?
36 Why multiple inheritance is not possible ?
37 What is interface?
38 Can you even overload the main method?
39 What is type casting? and its types?
40 What are the disadvantages of array?
41 What is super calling statement ?
42 can we do downcasting only implicitly?
43 What are constructors?
44 Can we do narrowing by both implicitly and explicitly?
45 Can a supercalling statement be parametrized and non-parametrized?
46 Can a constructor be parametrized and non-parametrized?
47 Why we go for collections?
48 What is constructor overloading?
49 What are this keyword and this calling statement?
50 What is the order of execution between SIB, IIb,main method and constructor
51 What is inheritance?
52 Does Constructo have the return type?
53 Can we have multiple catch block for a single try block
54 Why we need a scanner class?
55 Name some exceptions that you have seen?

Like, share and subscribe to the channel.
API Testing Playlist

Core Java Playlist

Selenium Playlist

Manual testing Playlist

Watch my other videos too,
Inheritance in Java video

Single level inheritance video

I work in the IT industry as a Senior Software QA Engineer in Bangalore, India and I have worked on mobile applications, web applications, and API testing.
The main reason behind this channel is to educate people about software testing so that it will help them to choose the right career and also to prepare for their interviews.

Adding my blog link

Adding my personal mail Id:

Adding my Quora profile link here:

Adding my Twitter account here,
or
Facebook Page:

Join us on Telegram today,
SoftwaretestingbyMKT
For the latest update on software jobs and to discuss each and everything about Software Testing also get an opportunity to get on an audio/video call with me directly to you.
I make videos on daily basics and also help student all over the world for FREE. If my videos are helpful in anyway help "SoftwaretestingbyMKT" reach billions by supporting
OR
Рекомендации по теме
Комментарии
Автор

No, in Java, you cannot execute two catch blocks together. When an exception is thrown in a try block, Java will execute only the catch block that matches the exception type and then proceed with the subsequent code. It won't execute multiple catch blocks simultaneously.

kanakaiahr
Автор

Hi, two catch blocks can be used in single try block. But only one of the catch block will handle your exception so only one catch block will be executed.

funshhcreator
Автор

Yes we can use multiple catch block but the because if the Exception in child class we would write first and after that we write parent Exception.

For eg:-
try{
System.out.println(10/0)
}
Catch(Arithmetic Exception e)
{
e.printStackTrace();
}
Catch(Exception e)
{
e.printStackTrace();
}

VivekYadav-sgte
Автор

Yes based on rxception hirerachy from most specific to most general. At a time only one exception occurs snd one catch block will be executed even thogh we have multiple catch blocks.

babu
Автор

We can do only one catch block to execute

naveenkumarm
Автор

Yes, It is possible but based on the exception hierarchy.

jyothsnakonakonda
Автор

No, it's not possible for two catch blocks to execute simultaneously in a single try-catch block. In exception handling, once an exception is caught by a catch block, the program control exits the try-catch block, and subsequent catch blocks are not executed. Each catch block is designed to handle a specific type of exception, and only the appropriate catch block will execute based on the type of exception thrown.

jaiyanthbalasubramaniam
Автор

No if any catch block gets executed it simply means compilar has found the exception then he will never go to the next one.Compilar will only execute the catch block which comes first and is appropriate.

richanema
Автор

Yes we can execute multiple catch block with single try block

gourinesare
Автор

It is posdible to execute two catch block together but these two catch block contains the two different exceptions if they contains tge same then first catch block will execute only

Maheshdy
Автор

No, we can execute one catch block only at a time

mahisentertainment
Автор

No. Multiple catch blocks will not execute together. if any catch block gets executed it means compilar has found the exception then it will never go to the next catch block.
Compilar will only execute the catch block which comes first.

smitamokashe
Автор

No, only one catch block will execute at a time. 2 catches together is not possible.

sowmyarama
Автор

No, you cannot execute two catch blocks together in most programming languages. Catch blocks are typically designed to handle specific types of exceptions, and only one catch block will be executed for a given exception.

sonalidhavre
Автор

No, For an exception only one catch block can be executed at a time.

mokshakrishnamurthy
Автор

Yes, inner catch blocks, try and catch block inside catch block is simulator of two catch blocks executing together. 😂

adepunaresh
Автор

Is possible but based on the exception hierarchy

sjbhaskar
Автор

No it will not possible . Because either only try block will execute or 1 catch block will execute

Itsme_Saku
Автор

No. It is not possible to execute 2 catch blocks together.

ruchavaidya
Автор

No, we may have multiple catch blocks but only 1 catch can be executed.

CrazyGitu