You are on page 1of 9

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: Internet Systems Consortium Sample Programming Placement Paper Level1 (Bolded option is your answer) 1. 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 */ } When is the B object, created in line 3, eligible for garbage collection? A after line 5 B after line 6 C after line 7 D There is no way to be absolutely certain. 2. public Object m() { Object o = new Float(3.14F); Object [] oa = new Object[l]; oa[0] = o; /* Line 5 */ o = null; /* Line 6 */ oa[0] = null; /* Line 7 */ return o; /* Line 8 */ } When is the Float object, created in line 3, eligible for garbage collection? A just after B just after line 6 C just after D just after line line 5 line 7 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

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

3. Which interface provides the capability to store objects using a keyvalue pair? A Java.util.Map D Java.util.Collect ion 4. Which collection class allows you to associate its elements with key values, and allows you to retrieve objects in FIFO (first-in, first-out) sequence? A B C D java.util.Array java.util.LinkedHash java.util.Hash java.util.TreeM List Map Map ap 5. Which is valid declaration of a float? A float f = 1F; B float f = 1.0; C float f = "1"; D float f = 1.0d; B Java.util.Set C Java.util.List

6. Which of the following are valid calls to Math.max? 1.Math.max(1,4) 2.Math.max(2.3, 5) 3.Math.max(1, 3, 5, 7) 4.Math.max(-1.5, -2.8f) A 1, 2 and 4 B 2, 3 and 4

C 1, 2 and 3

D 3 and 4

7. What is the name of the method used to start a thread execution? A init(); B start(); C run(); D resume();

8. Which of the following will directly stop the execution of a Thread?


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

A wait()

B notify()

C notifyall()

D null()

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

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

11. What is the prototype of the default constructor? A Test( ) B Test(void) C public Test( ) D public Test(void)

12. You want a class to have access to members of another class in the same package. Which is the most restrictive access that accomplishes this objective? A public B private C protected D default access 13. What is the narrowest valid returnType for methodA in line 3? public class ReturnIt { returnType methodA(byte x, double y) /* Line 3 */ { return (long)x / y * 2; } }
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

A int

B byte

C long

D double

14. Given a method in a protected class, what access modifier do you use to restrict access to that method to only the other members of the same class? A final B static C private D protected 15. Which four options describe the correct default values for array elements of the types indicated? 1.int -> 0 2.String -> "null" 3.Dog -> null 4.char -> '\u0000' 5.float -> 0.0f 6.boolean -> true A 1, 2, 3, 4 B 1, 3, 4, 5

C 2, 4, 5, 6

D 3, 4, 5, 6

16. Which is a reserved word in the Java programming language? A method B native C subclasses D reference

17. 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

18. Which of the following is NOT an Arithmetic operator in C#.NET?

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

A **

B+

C/

D %

19. Which of the following is the correct output for the C#.NET code snippet given below? Console.WriteLine(13 / 2 + " " + 13 % 2); A 6.5 1 B 6.5 0 C60 D61 20. What will be the output of the C#.NET code snippet given below? int num = 1, z = 5; if (!(num <= 0)) Console.WriteLine( ++num + z++ + " " + ++z ); else Console.WriteLine( --num + z-- + " " + --z ); A56 B65 C66

D77

21. Which of the following will be the correct output for the C#.NET program given below? namespace IndiabixConsoleApplication { struct Sample { public int i; } class MyProgram { static void Main() {
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

Sample x = new Sample(); x.i = 10; fun(x); Console.Write(x.i + " "); } static void fun(Sample y) { y.i = 20; Console.Write(y.i + " "); } } } A 10 20 B 10 10 C 20 10 D 20 20

22. How many bytes will the structure variable samp occupy in memory if it is defined as shown below? class Trial { int i; Decimal d; } struct Sample { private int x; private Single y; private Trial z; } Sample samp = new Sample();
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

A 20 bytes

B 12 bytes

C 8 bytes

D 16 bytes

23. Which of the following is NOT a namespace in the .NET Framework Class Library? A B System.Security C D System.Xml System.Proce System.Drawin ss g 24. Which of the following CANNOT belong to a C#.NET Namespace? A class B struct C enum D Data

25. What happens when a class with parameterized constructors and having no default constructor is used in a program and we create an object that needs a zero-argument constructor? A CompileB Preprocessing C Runtime D Runtime time error. error. error. exception. 26. A function with the same name as the class, but preceded with a tilde character (~) is called __________ of that class. A constructor B destructor C function D object

27. A union that has no constructor can be initialized with another union of __________ type. A different B same C virtual D class

28. Which of the following gets called when an object goes out of scope? A constructor B destructor C main D virtual function

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

29. Which of the following cannot be declared as virtual? A Constructor B Destructor C Data Members D Both A and C

30. Which of the following are NOT provided by the compiler by default? A Destructor B Zero-argument Constructor C Copy Destructor D Copy Constructor

31. If the programmer does not explicitly provide a destructor, then which of the following creates an empty destructor? A Preprocessor B Compiler C Linker D main()

32. How will you print \n on the screen? A printf("\n"); B echo "\\n"; C printf('\n'); D printf("\\n");

33. Which of the following function is more appropriate for reading in a multi-word string? A printf(); B scanf(); C gets(); D puts();

34. Which of the following correctly shows the hierarchy of arithmetic operations in C? A/+*B*-/+ C+-/* D/*+-

35. In which numbering system can the binary number 1011011111000101 be easily converted to?

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

A Decimal system

B Hexadecimal system

C Octal system D No

36. Which bitwise operator is suitable for turning on a particular bit in a number? A && operator B & operator C || operator D | operator

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

You might also like