You are on page 1of 8

Visit www.latestoffcampus.com for placement papers, interview tips & job updates.

Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

TITLE: HCL Sample Technical Placement Paper Level-1

(Bolded option is your answer)
1. What is the numerical range of a char? A -128 to 127 B -(215) to (215) - 1 C 0 to 32767 D 0 to 65535

2. Which is a valid declarations of a String? A String s1 = null; B String s2 = 'null'; C String s3 = (String) 'abc'; D String s4 = (String) '\ufeed';

3. Which three are valid declarations of a float? float f1 = -343; float f2 = 3.14; float f3 = 0x12345; float f4 = 42e7; float f5 = 2001.0D; float f6 = 2.81F; A 1, 2, 4 B 2, 3, 5 C 1, 3, 6 4. Which one is a valid declaration of a boolean?

D 2, 4, 6

A boolean b1 = B boolean b2 = C boolean b3 = D boolean b4 = 0; 'false'; false; Boolean.false(); 5. public class Myfile { public static void main (String[] args) {
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

String biz = args[1]; String baz = args[2]; String rip = args[3]; System.out.println("Arg is " + rip); } } Select how you would start the program to cause it to print: Arg is 2 A java Myfile B java Myfile 1 C java Myfile 1 D java Myfile 0 1 2 3 222 2234 322 6. Which three are methods of the Object class? notify(); notifyAll(); isInterrupted(); synchronized(); interrupt(); wait(long msecs); sleep(long msecs); yield(); A 1, 2, 4 B 2, 4, 5 C 1, 2, 6

D 2, 3, 4

7. Which cannot directly cause a thread to stop executing? A Calling the B Calling the C Calling D Calling read() SetPriority() wait() method notify() method on an method on a on an object. method on an InputStream object. Thread object. object. 8. Which two of the following methods are defined in class Thread? start() wait()
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

notify() run() terminate() A 1 and 4

B 2 and 3

C 3 and 4

D 2 and 4

9. Which method must be defined by a class implementing the java.lang.Runnable interface? A void run() B public void run() C public void start() D void run(int priority)

10. Which of the following will directly stop the execution of a Thread? A wait() B notify() C notifyall() D exits synchronized code.

11. Which will contain the body of the thread? A run(); B start(); C stop(); D main();

12. Which class or interface defines the wait(), notify(),and notifyAll() methods? A Object B Thread C Runnable D Class

13. void start() { A a = new A(); B b = new B(); a.s(b); b = null; /* Line 5 */ a = null; /* Line 6 */ System.out.println("start completed"); /* Line 7 */
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

} When is the B object, created in line 3, eligible for garbage collection? A after line 5 D There is no way to be absolutely certain. 14. Copy constructor must receive its arguments by __________ . A either pass- B only passC only passD only pass by by-value or by-value by-reference address pass-byreference 15. A union that has no constructor can be initialized with another union of __________ type. A different B same C virtual D class B after line 6 C after line 7

16. __________ used to make a copy of one class object from another class object of the same class type. A constructor B copy constructor C destructor D default constructor

17. Destructors __________ for automatic objects if the program terminates with a call to function exit or function abort. A are called B are inherited C are not called D are created

18. Where the default value of parameter have to be specified? A Function call B Function definition C Function prototype D Both B or C

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

19. Which of the following statement is correct? A The default B C++ allows C Both A and value for an the B. argument redefinition of cannot be a default function call. parameter. 20. Which of the following can be overloaded? A Object B Functions C Operators D C++ does not allow the redefinition of a default parameter.

D Both B and C

21. Which of the following means "The use of an object of one class in definition of another class"? A Encapsulation B Inheritance C Composition D Abstraction

22. Which of the following keyword is used to overload an operator? A overload B operator C friend D overrideD.

23. Which of the following is an invalid visibility label while inheriting a class? A public B private C protected D friend

24. Which of the following provides a reuse mechanism? A Abstraction B Inheritance C Dynamic binding D Encapsulation

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

25. Which of the following is the correct class of the object cout? A iostream B istream C ostream D ifstream

26. Which of the following cannot be used with the keyword virtual? A class B member functions C constructor D destructor

27. In which of the following collections is the Input/Output indexbased? Stack Queue BitArray ArrayList HashTable A 1 and 2 only

B 3 and 4 only C 5 only

D All of the above

28. Which of the following is NOT an interface declared in System.Collections namespace? A IComparer B Enumerable C Enumerator D IDictionaryComparer

29. Suppose value of the Capacity property of ArrayList Collection is set to 4. What will be the capacity of the Collection on adding fifth element to it? A4 B8 C 16 D 32

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

30. Which of the following is the correct way to find out the number of elements currently present in an ArrayList Collection called arr? A arr.Count B arr.GrowSize C arr.MaxIndex D arr.Capacity

31. The [Serializable()] attribute gets inspected at A Compiletime B Run-time C Design-time D Linking-time

32. Which of the following are correct ways to pass a parameter to an attribute? By value By reference By address By position By name A 1, 2

B 1, 2, 3

C 4, 5

D All of the above

33. Which of the following is the correct way to define a variable of the type struct Emp declared below? struct Emp { private String name; private int age; private Single sal; } Emp e(); e = new Emp(); Emp e = new Emp;
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

Emp e; e = new Emp; Emp e = new Emp(); Emp e; A 1, 3 B 2, 5

C 4, 5

D 1, 2, 4

34. Which of the following are value types? Integer Array Single String Long A 1, 2, 5

B 1, 3, 5

C 2, 4

D 3, 5

35. Which of the following does not store a sign? A Short B Integer C Long D Byte

36. What is the size of a Decimal? A 4 byte B 8 byte C 16 byte D 32 byte

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus