You are on page 1of 12

S.

No
1

9
10

11

12

13

14

15

16

17

18

19
20

21

22

23

24

25

26

27

28

29

30
31

32

33

34

35
Question
 When Overloading does not occur?

Which concept of Java is a way of converting real world objects in terms of class?

Which concept of Java is achieved by combining methods and attribute into a class?

What is it called where child object gets killed if parent object is killed?

Method overriding is combination of inheritance and polymorphism?

When does Exceptions in Java arises in code sequence?

Which of these keywords is not a part of exception handling?

What will be the output of the following Java program?


class exception_handling
{
public static void main(String args[])
{
try
{
int i, sum;
sum = 10;
for (i = -1; i < 3 ;++i)
sum = (sum / i);
}
catch(ArithmeticException e)
{
System.out.print("0");
}
System.out.print(sum);
}
}

Can we catch Throwable in Java?


What is the type and value of the following expression? (Notice the integer division)
"-4 + 1/2 + 2*-3 + 5.0"

What is garbage collection in the context of Java?

An abstract data type typically comprises a …………… and a set of ……………… respectively.

Which of the following statements about Java Threads is correct?

Which of these statements is incorrect?

What will be the output of the following Java code?


1. class multithreaded_programing
2. {
3. public static void main(String args[])
4. {
5. Thread t = Thread.currentThread();
6. System.out.println(t);
7. }
8. }

Which of the following exceptions is thrown by every method of Runtime class?

Which of these Exceptions is thrown by loadClass() method of ClassLoader class?

Which of these is a process of extracting/removing the state of an object from a stream?

Which of these process occur automatically by java run time system?


Which of the following matches nonword character using regular expression in java?

Object of which class is used to compile regular expression?

Which of these is a class which uses String as a key to store the value in object?

 Which of this method is used to change an element in a LinkedList Object?

What is use of wildcards?

What is the value returned by function compareTo() if the invoking string is greater than the string compared?

What will be the output of the following Java program?


1. class output
2. {
3. public static void main(String args[])
4. { String s = "Hello World";
5. int i = s.indexOf('o');
6. int j = s.lastIndexOf('l');
7. System.out.print(i + " " + j);
8.  
9. }

What is the purpose of BooleanSupplier function interface?

What is the return type of lambda expression?

Which feature of java 8 enables us to create a work stealing thread pool using all available processors at its target?

What is the substitute of Rhino javascript engine in Java 8?


What does Files.lines(Path path) do?

Which of these does Stream map() operates on

Which is aggregate operation in Java 8?

 Which of the following are not valid lambda expressions?

PermGen space has been replaced with which of these in Java 8?


Options & answer
a) More than one method with same name but different method signature and different number or type of parameters
b) More than one method with same name, same signature but different number of signature
c) More than one method with same name, same signature, same number of parameters but different type
d) More than one method with same name, same number of parameters and type but different signature

a) Polymorphism
b) Encapsulation
c) Abstraction
d) Inheritance

a) Encapsulation
b) Inheritance
c) Polymorphism
d) Abstraction

a) Aggregation
b) Composition
c) Encapsulation
d) Association

a) True
b) false

a) Run Time
b) Compilation Time
c) Can Occur Any Time
d) None of the mentioned

a) try
b) finally
c) thrown
d) catch

a) 0
b) 05
c) Compilation Error
d) Runtime Error

a)Yes
B)No
c)Not Recommended
d)Compiletime Error
(a) int -5
(b) int -4
(c) double -5.0
(d) double -4.5
(e) None of the above.

(a) The operating system periodically deletes all the java files available on the system.
(b) Any package imported in a program and not used is automatically deleted.
(c) When all references to an object are gone, the memory used by the object is automatically reclaimed.
(d) The JVM checks the output of any Java program and deletes anything that doesn’t make sense.
(e) Janitors working for Sun Micro Systems are required to throw away any Microsoft documentation found in the employees’ offices.

(a) Data representation, classes


(b) Database, operations
(c) Data representation, objects
(d) Control structure, operations
(e) Data representation, operations.

(a) Java threads don’t allow parts of a program to be executed in parallel


(b) Java is a single-threaded language
(c) Java’s garbage collector runs as a high priority thread
(d) Ready, running and sleeping are three states that a thread can be in during its life cycle
(e) Every java application is not multithreaded.

a) By multithreading CPU idle time is minimized, and we can take maximum use of it
b) By multitasking CPU idle time is minimized, and we can take maximum use of it
c) Two thread in Java can have the same priority
d) A thread can exist only in two states, running and blocked

a) Thread[5,main]
b) Thread[main,5]
c) Thread[main,0]
d) Thread[main,5,main]

a) IOException
b) SystemException
c) SecurityException
d) RuntimeException

a) IOException
b) SystemException
c) ClassFormatError
d) ClassNotFoundException

a) Serialization
b) Externalization
c) File Filtering
d) Deserialization

a) Serialization
b) Memory allocation
c) Deserialization
d) All of the mentioned

a) \w
b) \W
c) \s
d) \S

a) Pattern class
b) Matcher class
c) PatternSyntaxException
d) None of the mentioned

a) Array
b) ArrayList
c) Dictionary
d) Properties

a) change()
b) set()
c) redo()
d) add()

a) It is used in cases when type being operated upon is not known


b) It is used to make code more readable
c) It is used to access members of super class
d) It is used for type argument of generic method

a) zero
b) value less than zero
c) value greater than zero
d) none of the mentioned

a) 4 8
b) 5 9
c) 4 9
d) 5 8

a) represents supplier of Boolean-valued results


b) returns Boolean-valued result
c) There is no such function interface
d) returns null if Boolean is passed as argument

a) String
b) Object
c) void
d) Function

a) workPool
b) newWorkStealingPool
c) threadPool
d) workThreadPool

a) Nashorn
b) V8
c) Inscript
d) Narcissus

a) It reads all the files at the path specified as a String


b) It reads all the lines from a file as a Stream
c) It reads the filenames at the path specified
d) It counts the number of lines for files at the path specified

a)Function
b)Class
c)Inheritence
d)Predicate

a)Filter
b)Map
c)forEach
d)Predicate

a) () -> {}
b) () -> “Raoul”
c) () -> {return “Mario”;}
d) (Integer i) -> return “Alan” + i;

a) PermSpace
b) PermSpaceGen
c) Metaspace
d) MetaGenSpace

You might also like