delphi sample programmming placement paper level1
TRANSCRIPT
-
7/29/2019 Delphi Sample Programmming Placement Paper Level1
1/18
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
TITLE:Delphi Sample Programming Placement Paper Level1
(Bolded option is your answer)
1.If the binary eauivalent of 5.375 in normalised form is 0100 0000
1010 1100 0000 0000 0000 0000, what will be the output of the
program (on intel machine)?
#include
#include
int main()
{
float a=5.375;char *p;
int i;
p = (char*)&a;
for(i=0; i
-
7/29/2019 Delphi Sample Programmming Placement Paper Level1
2/18
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
4.How will you free the memory allocated by the following program?
#include
#include
#define MAXROW 3
#define MAXCOL 4
int main()
{
int **p, i, j;
p = (int **) malloc(MAXROW * sizeof(int*));
return 0;}
A memfree(int
p);
B dealloc(p); C malloc(p, 0); D free(p);
5.How many times "IndiaBIX" is get printed?
#include
int main()
{int x;
for(x=-1; x
-
7/29/2019 Delphi Sample Programmming Placement Paper Level1
3/18
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
A Infinite times B 11 times C 0 times D 10 times
6.How many times the while loop will get executed if a short int is 2byte wide?
#include
int main()
{
int j=1;
while(j
-
7/29/2019 Delphi Sample Programmming Placement Paper Level1
4/18
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
A 1. KR
Notation
2. ANSI
Notation
B 1. Pre ANSI
C Notation
2. KR Notation
C 1. ANSI Notation
2. KR Notation
D 1. ANSI
Notation
2. Pre ANSI
Notation
8.How many times the program will print "IndiaBIX" ?
#include
int main()
{
printf("IndiaBIX");main();
return 0;
}
A Infinite times B 32767 times C 65535 times D Till stack
overflows
9.In a file contains the line "I am a boy\r\n" then on reading this line
into the array str using fgets(). What will str contain?
A "I am a
boy\r\n\0"
B "I am a
boy\r\0"
C "I am a boy\n\0" D "I am a boy"
10.Which of the following operations can be performed on the file
"NOTES.TXT" using the below code?
FILE *fp;
fp = fopen("NOTES.TXT", "r+");
A Reading B Writing C Appending D Read and
Write11.To print out a and b given below, which of the following printf()
statement will you use?
#include
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Delphi Sample Programmming Placement Paper Level1
5/18
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
float a=3.14;
double b=3.14;
A printf("%f
%lf", a, b);
B printf("%Lf
%f", a, b);
C printf("%Lf %Lf",
a, b);
D printf("%f
%Lf", a, b);
12.What will be the output of the C#.NET code snippet given below?
byte b1 = 0xF7;
byte b2 = 0xAB;
byte temp;
temp = (byte)(b1 & b2);Console.Write (temp + " ");
temp = (byte)(b1^b2);
Console.WriteLine(temp);
A 163 92 B 92 163 C 192 63 D 0 1
13.What will be the output of the C#.NET code snippet given below?
int num = 1, z = 5;
if (!(num
-
7/29/2019 Delphi Sample Programmming Placement Paper Level1
6/18
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
byte temp;
temp = (byte)~b2;
Console.Write(temp + " ");
temp = (byte)(b1 > 2);
Console.WriteLine(temp);
A 102 1 38 B 108 0 32 C 102 0 38 D 1 0 1
15.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
16. What will be the output of the C#.NET code snippet given below?
int a = 10, b = 20, c = 30;
int res = a < b ? a < c ? c : a : b;
Console.WriteLine(res);
A 10 B 20 C 30 D error
17.Which of the following ways to create an object of the Sample class
given below will work correctly?
class Sample
{
int i;
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Delphi Sample Programmming Placement Paper Level1
7/18
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Single j;
double k;
public Sample (int ii, Single jj, double kk)
{
i = ii;
j = jj;
k = kk;
}
}
A Sample s1 =
new Sample();
B Sample s1 =
newSample(10);
C Sample s2 = new
Sample(10, 1.2f);
D Sample s3 =
new Sample(10,1.2f, 2.4);
18.What will be the output of the C#.NET code snippet given below?
namespace IndiabixConsoleApplication
{
class Sample
{
static Sample(){
Console.Write("Sample class ");
}
public static void Bix1()
{
Console.Write("Bix1 method ");
}
}class MyProgram
{
static void Main(string[ ] args)
{
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Delphi Sample Programmming Placement Paper Level1
8/18
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Sample.Bix1();
}
}
}
A Sample class
Bix1 method
B Bix1
method
C Sample class D Bix1 method
Sample class
19.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
20.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 is s2 B s1 = s2 C s1 == s2 D s1.Equals(s2)
21.What will be the output of the C#.NET code snippet given below?
namespace IndiabixConsoleApplication
{
class SampleProgram
{
static void Main(string[ ] args)
{string str= "Hello World!";
Console.WriteLine( String.Compare(str, "Hello World?"
).GetType() );
}
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Delphi Sample Programmming Placement Paper Level1
9/18
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
}
}
A 0 B 1 C System.Int32 D String
22.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);
A 3 6 B 2 5 C 3 5 D 2 6
23.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);
A 0 B 1 C 2 D -1
24.Which of the following will be the correct output for the C#.NET
program given below?
namespace IndiabixConsoleApplication{
class SampleProgram
{
static void Main(string[] args)
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Delphi Sample Programmming Placement Paper Level1
10/18
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
{
int num = 1;
funcv(num);
Console.Write(num + ", ");
funcr(ref num);
Console.Write(num + ", ");
}
static void funcv(int num)
{
num = num + 10; Console.Write(num + ", ");
}static void funcr (ref int num)
{
num = num + 10; Console.Write(num + ", ");
}
}
}
A 1, 1, 1, 1, B 11, 1, 11,
11,
C 11, 11, 11, 11, D 11, 11, 21, 11,
25.What will be the output of the C#.NET code snippet given below?
namespace IndiabixConsoleApplication
{
class SampleProgram
{
static void Main(string[] args)
{int[]arr = newint[]{ 1, 2, 3, 4, 5 };
fun(ref arr);
}
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Delphi Sample Programmming Placement Paper Level1
11/18
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
static void fun(ref int[] a)
{
for (int i = 0; i < a.Length; i++)
{
a[i] = a[i] * 5;
Console.Write(a[ i ] + " ");
}
}
}
}
A 1 2 3 4 5 B 6 7 8 9 10 C 5 10 15 20 25 D 5 25 125 6253125
26.Which of the following will be the correct output for the C#.NET
program given below?
namespace IndiabixConsoleApplication
{
class SampleProgram
{static void Main(string[] args)
{
int a = 5;
int s = 0, c = 0;
Proc(a, ref s, ref c);
Console.WriteLine(s + " " + c);
}
static void Proc(int x, ref int ss, ref int cc){
ss = x * x;
cc = x * x * x;
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Delphi Sample Programmming Placement Paper Level1
12/18
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
}
}
}
A 0 0 B 25 25 C 125 125 D 25 125
27.Which one is a valid declaration of a boolean?
A boolean b1 =
0;
B boolean b2
= 'false';
C boolean b3 =
false;
D boolean b4 =
Boolean.false();
28.switch(x)
{
default:
System.out.println("Hello");
}
Which two are acceptable types for x?
1.byte
2.long
3.char
4.float
5.Short
6.Long
A 1 and 3 B 2 and 4 C 3 and 5 D 4 and 6
29.class Foo
{
class Bar{ }}
class Test
{
public static void main (String [] args)
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Delphi Sample Programmming Placement Paper Level1
13/18
-
7/29/2019 Delphi Sample Programmming Placement Paper Level1
14/18
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
{
public static int y;
public static void foo(int x)
{
System.out.print("foo ");
y = x;
}
public static int bar(int z)
{
System.out.print("bar ");
return y = z;}
public static void main(String [] args )
{
int t = 0;
assert t > 0 : bar(7);
assert t > 1 : foo(8); /* Line 18 */
System.out.println("done ");
}}
A bar B bar done C foo done D Compilation
fails
32.public class Test2
{
public static int x;
public static int foo(int y)
{return y * 2;
}
public static void main(String [] args)
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Delphi Sample Programmming Placement Paper Level1
15/18
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
{
int z = 5;
assert z > 0; /* Line 11 */
assert z > 2: foo(z); /* Line 12 */
if ( z < 7 )
assert z > 4; /* Line 14 */
switch (z)
{
case 4: System.out.println("4 ");
case 5: System.out.println("5 ");default: assert z < 10;
}
if ( z < 10 )
assert z > 4: z++; /* Line 22 */
System.out.println(z);
}
}which line is an example of an inappropriate use of assertions?
A Line 11 B Line 12 C Line 14 D Line 22
33.public class Outer
{
public void someOuterMethod()
{
//Line 5}
public class Inner { }
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Delphi Sample Programmming Placement Paper Level1
16/18
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
public static void main(String[] argv)
{
Outer ot = new Outer();
//Line 10
}
}
Which of the following code fragments inserted, will allow to compile?
A new Inner();
//At line 5
B new Inner();
//At line 10
C new ot.Inner();
//At line 10
D new
Outer.Inner();
//At line 10
34.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;
}
}A int B byte C long D double
35.What will be the output of the program?
try
{
int x = 0;
int y = 5 / x;
}
catch (Exception e)
{
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Delphi Sample Programmming Placement Paper Level1
17/18
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
System.out.println("Exception");
}
catch (ArithmeticException ae)
{
System.out.println(" Arithmetic Exception");
}
System.out.println("finished");
A finished B Exception C Compilation fails. D Arithmetic
Exception
36.What will be the output of the program?
public class X
{
public static void main(String [] args)
{
try
{
badMethod();
System.out.print("A");}
catch (RuntimeException ex) /* Line 10 */
{
System.out.print("B");
}
catch (Exception ex1)
{
System.out.print("C");}
finally
{
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Delphi Sample Programmming Placement Paper Level1
18/18
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
System.out.print("D");
}
System.out.print("E");
}
public static void badMethod()
{
throw new RuntimeException();
}
}
A BD B BCD C BDE D BCDE
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/