Placement Papers for All Companies

3i infotech
Abacus Infotech
Abatix
Abaxis
ABB
ACC Limited
Accel Frontline
Accenture
Aditi Technologies
Adobe System
ADP
Agilysys
AgreeYa
AIG
AirNet
Alanco Technologies
Alle Technologies
Allfon
Alter Systems
Amazon
AMDL
Amdocs
AMI
Amiti Software Technologies
ANZ
Apple
Applied Materials
Apps Associates
Aricent
ASDC
Ashok Leyland Ltd
Asian Paints
Aspire System
AT & T
Atlas Copco
Atos Origin
AXA Technology Services
Axes Technology
Bain
Bajaj
Bayer
Bharti Airtel Ltd
Bhawan Cybertek
Birlasoft
Blue Star Infotech
BMC
BOB
Brakes India
C-DOT
CA Technologies
Cadence
Calsoft
Canarys
Capgemini
Caterpillar
Celstream
CGI Group
Changepond Technologies
Cimtrix Systems
Cisco system
Citicorp Overseas Software Ltd
ClinTech
CMC Limited
CMS
Cognizant
Compaq
Consagous Technologies
Convergys
CORDYS
CRISIL
Crompton Greaves
CSC
CSFB
CtrlS Datacenters Ltd
Cummins
Cyient
Daffodil
Daimler
Dell
Deloitte
Delphi-TVS
Dharma Systems
Directi
DSRC
Eicher
ELGI
ELICO
EMC Corporation
Emphasis
Ericsson
Ernst & Young
ESKO
Essar
Facebook
Fanuc Corporation
Fidelity
Flextronics
Flipkart
Freescale
Fujitsu
Gajshield
GE
Genpact India
Geodesic
Geometric Limited
GlobalEdge
GlobalLogic
GMR Group
Godrej Infotech
Google
Grapecity
Harita - TVS
HCL
HCL Technologies
Headstrong
Healthasyst
HEC Ltd
Hexaware
HFCL
Holool
Honeywell
HP
HTC Global Services
Huawei
Hughes
Hyundai
IBM
IBS Software Services
IGate
Ikanos
IKOS
Impetus
iNautix
Indecomm
IndiaBulls Power Limited
Inductis-EXL
Industrial Alliance
Infineon
Infogain
Infosys
Intec
Integra
Intel
Intergraph
ITC Infotech
Jindal Steel and Power Limited
KPIT
L & T
L & T Infotech
LG Soft
Linde India Ltd
LnT Emsys
LnT-ECC
Lucas - TVS
Mahindra Engineering Services Ltd
Mahindra Ltd
Maruti
Matrix
Maveric Systems
McAfee
Microland
Microsoft
Mindtree
Miraclesoft
MKCL
Motorola
Mu-Sigma
Nagarro
NASSCOM
NCR Corporation
Ness Technologies
Neudesic
NIIT Technologies
Novell
Nvidia
Oracle
Persistent
Philips
Planetasia
Polaris
Poornam Info Vision
PSI Data Systems Limited
Quest-Global
Quinnox
R Systems
Redpine
Reliance Energy
Robert Bosch
RS Software
Samsung
SAP labs India
Sapient
Sasken Communications
Schneider India
Serco
Siemens
Sierra Atlantic
SkyTECH
Soliton
Sonata Software
Sony India
SQL Star
Steria
Subex Limited
Sutherland Global Services
Syntel
Talisma
Tata motors
Tata technologies
Tata-ELXSI
TCE
TCS
Tech Mahindra
Temenos
Tesco
Texas Instruments
Thermax
ThoughtWorks
Torry Harris
Triad
Trianz
Trilogy
TVS Motor
Unisys
UnitedHealth Group
UST Global
UTC Aerospace System
Valuelabs
Vedanta
Verifone
Verizon
Virtusa
Vision Infotech
Vizual
VMware
Wipro
Yahoo
YASH Technologies
Zenith
Zensar Technologies
ZTE

Amiti Technical Test April 2007

Posted on :18-04-2016

Q1. What will happen when you attempt to compile and run the following code?

public class Holt extends Thread
{
private String sThreadName;
public static void main(String argv[])
{
Holt h = new Holt();
h.go();
}
Holt(){}
Holt(String s)
{
sThreadName = s;
}
public String getThreadName()
{
return sThreadName;
}
public void go()
{
Holt first = new Holt(”first”)
first.start();
Holt second = new Holt(”second”)
second.start();
}
public void start()
{
for(int i = 0; i < 2; i ++)
{
System.out.println(getThreadName() +i
try
{
Thread.sleep(100);
}
catch(InterruptedException e)
{
System.out.println(e.getMessage()); 
}
}
}
}

a) Compile time error 
b) Output of first0, second0, first0, second1 
c) Output of first0, first1, second0, second1 
d) Runtime error 

 

Q2. Consider these classes, defined in separate source files:

public class Test1 {
public float aMethod(float a, float b)throws IOException {
public class Test2 extends Test1 {
}

Which of the following methods would be legal (individually) at line 2 in class Test2?

a) float aMethod(float a, float B){ } 
b) public int aMethod(int a, int b)throws Exception { } 
c) public float aMethod(float a, float b)throws Exception { } 
d) public float aMethod(float p, float q) RuntimeException{ } 

 

Q3. Given the following code how could you invoke the Base constructor that will print out the string “base constructor”;

class Base
{
Base(int i)
{
System.out.println(”base constructor”); 
}
Base()
{ }
}
public class Sup extends Base
{
public static void main(String argv[])
{
Sup s= new Sup();
//One
}
Sup()
{
//Two
}
public void derived()
{
//Three
}
}

a) On the line After //One put Base(10); 
b) On the line After //One put super(10); 
c) On the line After //Two put super(10); 
d) On the line After //Three put super(10); 

 

Q4. Consider the following classes, declared in separate source files: 

public class Base {
public void method(int i) {
System.out.println(”Value is ” + i);
}
}

public class Sub extends Base {
public void method(int j) {
System.out.println(”This value is ” + j);
}
public void method(String s) {
System.out.println(”I was passed ” + s);
}
public static void main(String args[]) {
Base b1 = new Base();
Base b2 = new Sub();
b1.method(5);
b2.method(6);
}

What output results when the main method of the class Sub is run?

a) Value is 5
Value is 6
b)This value is 5
This value is 6 
c) Value is 5
This value is 6 
d) This value is 5
Value is 6 
e) I was passed 5
I was passed 6

 

Q5. What will be the output of the following program?

class Parent
{
private void method1()
{
System.out.println(”Parent’s method1());”
}
public void method2()
{
System.out.println(”Parent’s method2());”
method1();
}
}
class Child extends Parent
{
public void method1()
{
System.out.println(”Child’s method1());”
}
public static void main(String args[])
{
Parent p = new Child();
p.method2();
}
}

 

Q6. Which of the following statements are true?

a) System.out.println( -1 >>> 2 );will output a result larger than 10 
b) System.out.println( -1 >>> 2); will output a positive number 
c) System.out.println( 2 >> 1 );will output the number 1 
d) System.out.println( 1 <<< 2 );will output the number 4 

 

Q7. What results from attempting to compile and run the following code?

public class Ternary
{
public static void main(String args[])
{
int a = 5;
System.out.println(”Value is - ” + ((a < 5) ? 9.9 : 9)
}
}

a) Prints: Value is - 9
b) Prints: Value is - 5
c) Compilation error
d) Value is - 9.0

 

Q8. What will happen when you attempt to compile and run the following code snippet?

Boolean b = new Boolean(”TRUE”);
if(b.booleanValue())

System.out.println(”Yes : ” +B); 
}
else

System.out.println(”No : ” +B);

a) The code will not compile. 
b) It will print - Yes: true 
c) It will print - Yes: TRUE 
d) It will print - No: false 
e) It will print - No: FALSE 

 

Q9. What will be the output by the following code?

public class MyFor
{
public static void main(String argv[])
{
int i;
int j;
outer:
for (i=1;i <3;i++){
inner:
for(j=1; j<3; j++)
{
if (j== 2)
continue outer;
System.out.println(”Value for i=” + i + ” Value for j=” +j);
}
}

a) Value for i=1 Value for j=1 
b) Value for i=2 Value for j=1 
c) Value for i=2 Value for j=2 
d) Value for i=3 Value for j=1 

 

Q10. What is the value of z?

double z = 7 / (3 + 0.5)

a) 0.5
b) 2.0
c) 2.83333333
d) 3.0 

 

Q11. What will happen when you attempt to compile and run the following code?

public class Tux extends Thread
{
static String sName = “vandeleur”;
public static void main(String argv[])
{
Tux t = new Tux();
t.piggy(sName);
System.out.println(sName)
}
public void piggy(String sName)
{
sName = sName + ” wiggy”;
start();
}
public void run()
{
for(int i=0;i < 4; i++)
{
sName = sName + “ ” + i;
}
}
}


a) Compile time error 
b) Compilation and output of “vandeleur wiggy” 
c) Compilation and output of “vandeleur wiggy 0 1 2 3″ 
d) Compilation and output of either “vandeleur”, “vandeleur 0″, “vandeleur 0 1″ “vandaleur 0 1 2″ or “vandaleur 0 1 2 3″ 

 

Q12. Consider the class hierarchy shown below:

class FourWheeler implements DrivingUtilities
class Car extends FourWheeler
class Truck extends FourWheeler
class Bus extends FourWheeler
class Crane extends FourWheeler

Consider the following code below:

DrivingUtilities du;
FourWheeler fw;
Truck myTruck = new Truck();
du = (DrivingUtilities)myTruck;
fw = new Crane();
fw = du;

Which of the statements below are true?

a) Line 4 will not compile because an interface cannot refer to an object. 
b) The code will compile and run. Ch etan aS
c) The code will not compile without an explicit cast at line 6, because going down the hierarchy without casting is not allowed. 
d) The code at line 4 will compile even without the explicit cast. 
e) The code will compile if we put an explicit cast at line 6 but will throw an exception at runtime.

 


  
   






FreshersLive - No.1 Job site in India. Here you can find latest 2016 government as well as private job recruitment notifications for different posts vacancies in India. Get top company jobs for both fresher and experienced. Job Seekers can get useful interview tips, resume services & interview Question and answer. Practice online test free which is helpful for interview preparation. Register with us to get latest employment news/rojgar samachar notifications. Also get latest free govt and other sarkari naukri job alerts daily through E-mail.

closepop
closepop