Sie sind auf Seite 1von 10

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: Manhattan Associates Programming Placement Paper Level1 (Bolded option is your answer) 1. Which is a valid keyword in java? A interface B string C Float D unsigned

2. Which three are valid declarations of a char? 1.char c1 = 064770; 2.char c2 = 'face'; 3.char c3 = 0xbeef; 4.char c4 = \u0022; 5.char c5 = '\iface'; 6.char c6 = '\uface'; A 1, 2, 4 B 1, 3, 6

C 3, 5

D 5 only

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

4. public class While { public void loop() { int x= 0; while ( 1 ) /* Line 6 */ { System.out.print("x plus one is " + (x + 1)); /* Line 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

} } Which statement is true? A syntax error B syntax errors C syntax errors on line 1. on lines 1 and 6. on lines 1, 6, and 8. 5. Which is true about a method-local inner class? A must be marked final. B can be marked abstract.

D syntax error on line 6.

C can be marked D can be public. marked static.

6. class Foo { class Bar{ } } class Test { public static void main (String [] args) { Foo f = new Foo(); /* Line 10: Missing statement ? */ } } which statement, inserted at line 10, creates an instance of Bar? A Foo.Bar b = B Foo.Bar b = C Bar b = new D Bar b = f.new new Foo.Bar(); f.new Bar(); f.Bar(); Bar(); 7. public class Test { public void foo() {
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

assert false; /* Line 5 */ assert false; /* Line 6 */ } public void bar() { while(true) { assert false; /* Line 12 */ } assert false; /* Line 14 */ } } What causes compilation to fail? A Line 5 B Line 6

C Line 12

D Line 14

8. You want subclasses in any package to have access to members of a superclass. Which is the most restrictive access that accomplishes this objective? A public B private C protected D transient 9. What will be the output of the program? try { int x = 0; int y = 5 / x; } catch (Exception e) { System.out.println("Exception");
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

} catch (ArithmeticException ae) { System.out.println(" Arithmetic Exception"); } System.out.println("finished"); A finished B Exception C Compilation fails 10. Which two are valid constructors for Thread? 1.Thread(Runnable r, String name) 2.Thread() 3.Thread(int priority) 4.Thread(Runnable r, ThreadGroup g) 5.Thread(Runnable r, int priority) A 1 and 3 B 2 and 4 C 1 and 2

D Arithmetic Exception

D 2 and 5

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

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

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

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

14. Which of the following .NET components can be used to remove unused references from the managed heap? A Common B CLR C Garbage D Class Loader Language Collector Infrastructure 15. Code that targets the Common Language Runtime is known as A Unmanaged B Distributed C Legacy D Managed Code

16. Which of the following are the correct ways to increment the value of variable a by 1? 1.++a++; 2.a += 1; 3.a ++ 1; 4.a = a +1; 5.a = +1; A 1, 3

B 2, 4

C 3, 5

D 4, 5

17. 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 18. What will be the output of the C#.NET code snippet given below? byte b1 = 0xAB; byte b2 = 0x99; byte temp;
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

temp = (byte)~b2; Console.Write(temp + " "); temp = (byte)(b1 << b2); Console.Write (temp + " "); temp = (byte) (b2 >> 2); Console.WriteLine(temp); A 102 1 38 B 108 0 32

C 102 0 38

D101

19. What will be the output of the C#.NET code snippet given below? int i, j = 1, k; for (i = 0; i < 5; i++) { k = j++ + ++j; Console.Write(k + " "); } A 8 4 16 12 20 B 4 8 12 16 20

C 4 8 16 32 64

D 2 4 6 8 10

20. Which of the following will be the correct output for the C#.NET code snippet given below? String s1 = "ALL MEN ARE CREATED EQUAL"; String s2; s2 = s1.Substring(12, 3); Console.WriteLine(s2); A ARE B CRE C CR

D REA

21. Which of the following will be the correct output for the C#.NET code snippet given below?
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 s1 = "Nagpur"; String s2; s2 = s1.Insert(6, "Mumbai"); Console.WriteLine(s2); A B Nagpur NagpuMumbair Mumbai

C D Mumbai NagpurMumbai

22. If s1 and s2 are references to two strings, then which of the following is the correct way to compare the two references? A s1.Equals(s2) B s1 is s2 C s1 = s2 D s1 == s2

23. Which of the following will be the correct output for the C#.NET code snippet given below? String s1="Kicit"; Console.Write(s1.IndexOf('c') + " "); Console.Write(s1.Length); A36 B 25 C 35

D 26

24. Which of the following will be the correct output for the C#.NET code snippet given below? String s1 = "Five Star"; String s2 = "FIVE STAR"; int c; c = s1.CompareTo(s2); Console.WriteLine(c); A0 B1

C 2

D -1

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 function / type of function cannot be overloaded? A Member function B Static function C Virtual function D Both B and C

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

27. Which of the following function / types of function cannot have default parameters? A Member B main() function of class C Member DBoth B and C function of structure 28. Copy constructor must receive its arguments by __________ . A pass-by-value B pass-by-value C pass-byD pass by or pass-byreference address reference 29. __________ 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

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

31. Which of the following is the correct usage of conditional operators used in 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

A a>b ? c=30 : c=40;

B a>b ? c=30;

C max = a>b ? a>c?a:c:b>c?b:c

D return (a>b)?(a:b)

32. Which of the following special symbol allowed in a variable name? A * (asterisk) B | (pipeline) C - (hyphen) D_ (underscore)

33. How would you round off a value from 1.66 to 2.0? A ceil(1.66) B floor(1.66) C roundup(1.66) D roundto(1.66)

34. Which of the following is not user defined data type? 1: struct book { char name[10]; float price; int pages; }; 2: long int l = 2.35; 3: enum day {Sun, Mon, Tue, Wed}; A1 B2 C 3 D4 35. Is the following statement a declaration or definition? extern int i; A Declaration B Definition C Function D Error

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

36. Identify which of the following are declarations 1 : extern int x; 2 : float square ( float x ) { ... } 3 : double pow(double, double); A1 B 1 and 3 C2

D3

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

Das könnte Ihnen auch gefallen