|
|
|
|
350 Mock Questions on SCJP 1.5 - JUST Rs.200 or 7 USD
Send us mail to sales@javabeat.net
more details
|
|
SCJP 5.0 - Enum Mock Questions - 1
Q1)Select all the correct statements regarding Enums (Select any 2 options)
-
a) All enums are subclasses of interface java.lang.Enum.
-
b) Enums is simply a data structure and hence it is not compiled to a
.class file.
-
c) Enums enable you to define a new data type. For example, If you create
an Enum 'Days' you can declare a variable of type 'Days'.
-
d) All instances of Enums are serializable by default.
Answer:
Q1)c, d
Explanation :
-
a) java.lang.Enum is a class and not an interface.
-
b) Enums are compiled to a .class file.
-
c) Enums enable you to define a new data type, in a manner similar to the
way a class allows you to define a new data type.
-
d) Enums are subclasses of class java.lang.Enum, which implements the
interface java.io.Serializable. If a class implements the interface
java.io.Serialisable, its objects are serializable.
|
|
350 Mock Questions on SCJP 1.5 - JUST Rs.200 or 7 USD
Send us mail to sales@javabeat.net
more details
|
|
|