CS3391 CIA-II - Key-Set - A
CS3391 CIA-II - Key-Set - A
CIA - II
Study ALL Questions.
SHORT QUESTIONS
1. What is Finally keyword in Exception handling?
Ans. The finally block is used to execute important code, such as
: closing resources, regardless of whether an exception is thrown
or not. It is always executed after the try and catch blocks.
Syntax
try
{
// try block code
}
catch ( ExceptionType e)
{
// Handle exception
}
finally
{
//code that has to be executed finally
}
FileInputStream
FileOutputStream
FilterInputStream
Ans. FilterOutputStream
: ByteArrayInputStream
ByteArrayOutputStream
PipedInputStream
PipedOutputStream
Error Exception
Represents serious Represents conditions
issues, such as that that applications can
applications generally catch and handle.
cannot recover from.
OutOfMemoryError IOException
ArithmeticException.
17. Why synchronization is required in thread?
Synchronization is required to manage access to
shared resources when multiple threads are
involved, preventing conflicts and ensuring data
Ans.
consistency. Without synchronization, multiple
:
threads might modify shared data simultaneously,
leading to incorrect results.