STD 10 - Q Ans
STD 10 - Q Ans
* Java provides the foll owing keywords Q> What is the use of the “finally”
for performing exception - handling block?
operations : - Ans> The “finally” block is used to
(a) try (b) catch (c) throws specify such statements that are to be
(d) finally executed by the JVM irrespective of
whether an exceptio n has occurred or
not.
StringIndexOutOfBoundsException
FileNotFoundExceptio n
MethodNotFoundException
NumberFormatException
InputMismatchException
1
Q> What are streams in Java?
Ans> A stream implies a flow of data between the RAM, CPU and I/O devices.
Java has three stream s : -
(a) System.in, which is related to the keybo ard and is used for accepting data at run -
time.
(b) System.o ut, which is related to the VDU and is used to display th e output.
(c) System.out, which is also related to the VDU and is used to display error -messages.
Every primitive data -type has a corresponding wrapper -class wherein the primitive
data-type always begins with a lower -case letter while its correspo nding wrapper -class
begins with an upper -case letter.
Data-Type Wrapper-Class
char Character
byte Byte
short Short
int Integer
long Long
float Float
double Double
The wrapper -classes are defined in the ‘java.lang’ package and are used to : -
i> Represent primitive values as objects.
ii> To perform conversions between strings and primitive data -types.
Students must also thoroughly revise the topics covered in Std -IX
as part of their Board-Exam preparations.