Anda di halaman 1dari 3

ERevMax Technologies

in association with

InnoServ Solutions

Presents

TEST ON JAVA

Full Marks: 100 PASS MARKS: 50 TIME: 100 MIN NO OF QUESTIONS: 100

All Questions are mandatory .Figures in right margin indicate marks for each question. There is no
negative marking. Answers should be written on question paper for Section 1 and 2 only. Overwriting
of answers will be deemed as a malicious practice. Hence be sure before answering the questions in
the answer sheet. Practical project needs to be compressed and sent to designated email.

SECTION -1: FILL IN THE BLANKS [25 MARKS]

A) The class present in the java.util package used for taking input/output is called _______. [1]
B) The full form of JRE is _______________________________________________ and JVM is
___________________________. [2]
C) The content of any class file is called __________ code. [1]
D) To access parent class members, we use the ____________ keyword and to access current class
members, we use ________________ keyword. [2]
E) To use a package in a program we use the ___________________ keyword. [1]
F) To inherit a class, we use the _________ keyword and for an interface we use the ___________
keyword [2]
G) To find the length of an array we have to use the _____________ method [1]
H) The Oracle IDE used for doing java programs is called _______________ [1]
I) To access a package from anywhere we have to set the package path in the
_________________ environment variable. [1]
J) The ___________ method of Collections can sort an Array List [1]
K) The _______________ operator is used to check whether the object belongs to a specific class
or interface [1]
L) One interface can inherit another interface using the _______________ keyword. [1]
M) To stop inheritance of a class we can use the ____________ keyword before it. [1]
N) The __________ method is used to insert an element within a Map. [1]
O) The properties files which can store key/value pairs like Hash table has an extension called
_______________. [1]
P) The ______________ interface object can store all the keys of the Hash table object. [1]
Q) To change the format of display of a date we can use the _______________ class. [1]
R) The ____________ method of the File class check the existence of a particular file. [1]
S) The EOF character of any file is ___________. [1]
T) To connect to the Server the Socket class needs to know the ______________ and
_____________. [1]
U) We usually use the _____________ class for reading from a socket [1]
V) The ____________ method of System class forces a garbage collection. [1]

SECTION -2: TRUE/FALSE [1 MARK EACH] [40 MARKS]

A) The finally method executed whether or not an exception occurs in a program


B) The FileOutputStream class can be used to read a file
C) ArrayList can contain duplicate elements.
D) We cannot create our own exceptions in java.
E) A static variable is not shared among different objects belonging to the same class.
F) We can call a static method using an object instance of the class.
G) Using generics we restrict the entry of any datatype within an object of a class in compile time.
H) Lambda expression is an easy way to implement a method of an interface.
I) We can use a for-each loop to traverse an Array List
J) LinkedList is a type of Array List and is slower in processing.
K) One interface can nest another interface.
L) An array can have equal no of columns within each row.
M) There is no direct method in the Scanner class for taking input of a character.
N) The HashSet object can contain duplicate elements.
O) The FileWriter class can be an alternative to the FileInputStream class
P) Packages in java are usually written in small letters.
Q) A method can have variable arguments in java.
R) We cannot supply command line arguments within net beans.
S) The foreach loop is a read-only, forward only, increment by one loop.
T) A foreach loop cannot be used to traverse an array.
U) Multiple interfaces can be implemented in a class in java.
V) We cannot create anonymous objects in Java.
W) There can be multiple public classes in a single program in java.
X) Many main methods can reside in a single program in java in different classes.
Y) The entry method is used to load the key/value pairs from a properties file to properties object.
Z) If no constructor is present in the class then compiler supplies a non-parameterized constructor.
AA) All java classes inherit the Object class.
BB) Constructors in java class are inherited.
CC) Constructors can have a different class name as that of the class.
DD) We can create pure object instance of an abstract class and interface.
EE) Abstract class may contain a concrete method definition.
FF) Abstract class must contain an abstract method.
GG) String constants are immutable in Java.
HH) Serialization is the method for converting a file to a network stream.
II) Arrays are passed by reference in Java.
JJ) A single class in java can inherit multiple classes.
KK) An abstract class can have data member, abstract method, method body, constructor and even
main() method.
LL) Java is object-oriented programming language.
MM) Currently Java is owned by Sun Micro Systems
NN) A try block can have multiple finally blocks

SECTION -3: Practicals [35 MARKS]

Create a using Net beans IDE called Erev<Yourname>(eg. If your name is “Raj” project name will be
“ErevRaj”). Create a package called coretest within it. Create an abstract class called Employee. It should
have a no-args constructor with a message “An employee has been appointed”. It should have the fields
of Name,age,designation and salary with data type of String,int,String and double respectively. It should
also possess a Finalize method with a message “An employee is retiring”. Create two interfaces Staff and
Officer. Staff interface should have the method inputDetails() and Officer interface with displayDetails()
declared within it. Make a class called Developer with which extends the Employee class and
implements the Staff and Officer interface and implement the required methods which will take
input/display of all the relevant information of the employee .Make a class called EntryDev with main
method in it. It should ask for number of employees for input( and you should min give 3). After giving
input for that number of employees, each employee should be given details using the inputDetails
method and then all the employees should be stored in an Arraylist which will be again stored in a file
called Developer.db. Make another class called DisplayDev which will have main method for reading the
Arraylist of Employees from the file and displaying details of the employee using the displayDetails
method. Remember to create all the classes and interfaces in separate files within the same package.

SECTION -4: PERSONAL INFORMATION

A) FULL NAME__________________________________.
B) EMPNO.__________________________________.
C) DESIGNATION:_______________________________.

SECTION -5: FOR OFFICE USE ONLY (PLEASE LEAVE IT BLANK)

MARKS OBTAINED:

INVIGILATOR:

DATE:

================================= ===THE END=========================================

Anda mungkin juga menyukai