Publish Events & Email Alerts

Subscribe our email alerts and Publish your events with us

You'll Receive & Get Benefits :

Publish & Subscribe

 Technicalsymposium

Software Companies Placement Papers-GlobalLogic-Free Download

What is the output of the following code when compiled and run? Select two correct answers.

public class Question01 {

public static void main(String[] args){

int y=0; //line 1

int x=z=1; //line 2

System.out.println(y+","+x+","+z); //line 3

}

}

A. Prints 0,1,1

B. Error during compilation at line 1

C. Prints 0,0,1

D. Error during compilation at line 3

E. Error during compilation at line 2

Question 2. Select three correct statements.

A. The garbage collection thread cannot outlive the last user thread.

B. The garbage collection can be forced by invoking System.gc().

C. The garbage collection thread is a non-deamon thread.

D. The finalize() method is invoked at most once by the JVM for any given object.

E. The finalize() method may resurrect the object upon which it has been invoked.

What is the output of the following code when compiled and run? Select one correct answer.

import java.io.*;

public class Question05 {

public static void main(String[] args) {

Question05Sub myref = new Question05Sub();

try{

myref.test();

}catch(IOException ioe){}

}

void test() throws IOException{

System.out.println("In Question05");

throw new IOException();

}

}

class Question05Sub extends Question05 {

void test()throws IOException {

System.out.println("In Question05Sub");

}

}

A. Prints:

In Question05Sub

B. Prints:

In Question05

C. Prints:

In Question05

In Question05Sub

D. Prints:

In Question05Sub

In Question05

E. The code does not compile.

Select two correct statements about the code given below?

class A{}

class B extends A implements E{} //line 1

class C extends A{}

class D extends B{}

interface E{}

public class Question07 {

public static void main(String[] args) {

A a = new D(); //line 2

C c = new C(); //line 3

E e = (E)a; //line 4

B b = (B)e; //line 5

}

}

A. The code compiles without error and runs fine.

B. Compilation error on line 1 because interface E is not yet declared (forward-referencing).

C. Compilation error on line 4 because class A does not implement interface E.

D. The cast on line 4 is mandatory.

E. The cast on line 5 is not mandatory.

How many objects are eligible for garbage collection immediately after line 1? Select one correct answer.

public class Question08 {

public static void main(String[] args) {

Question08 q08 = new Question08();

q08.doSomething(); //line 1

Thread.sleep(20000);

}

public void doSomething(){

Object[] objArray = new Object[2];

for(int i=0;i

objArray[i] = new Object();

}

}

}

A. 0

B. 1

C. 2

D. 3

E. 4

What is the output of the following code when compiled and run? Select one correct answer.

public class Question09 {

public static void main(String[] args) {

try {

int i = (int)(Math.random()*10);

if(i<=5)

System.out.println("i = "+i);

else

throw new Exception("i > 5");

} catch (Exception e){

System.err.println(e.getMessage()+" (i="+i+")");

}

}

}

A. The output cannot be determined.

B. Compilation error.

C. An exception is thrown at runtime.

D. Output is i = 2

E. Output is i > 5 (i=6)

What is the output of the following code when compiled and run? Select one correct answer.

public class Question10 {

public static void main(String[] args) {

new Question10().doSomething();

}

public void doSomething(){

int i=5;

Thread t = new Thread(new Runnable(){

public void run(){

for(int j=0;j<=i;j++){

System.out.print(" "+j);

}

}

});

t.start();

}

}

A. Prints 0 1 2 3 4

B. Compilation error.

C. No output.

D. IllegalThreadStateException is thrown at runtime.

E. Prints 0 1 2 3 4 5

What is the output of the following code when compiled and run? Select one correct answer.

public class Question11 {

public static void main(String[] args) {

StringBuffer buf1 = new StringBuffer("Hello W");

addSomeStuff(buf1);

System.out.println(buf1.toString());

}

public static void addSomeStuff(StringBuffer buf){

StringBuffer b = buf.replace(6,10,"orld");

System.out.println(b.delete(0,1).toString());

}

}

A. Prints Hello World Hello World

B. Prints Hello orld Hello orld

C. Prints Hello orld ello orld

D. Prints ello orld ello orld

E. Compilation error.



What is the output of the following code when compiled and run? Select two correct answers. (Note: when an instance of a Vector is printed, its content appear between square brackets [])

import java.util.*;

public class Question13 {

public static void main(String[] args) {

Vector col = new Vector();

col.add(new Integer(1));

col.add(new Integer("2"));

col.add(new Float(3.2d)); //line 1

col.add(col.elementAt(1));

col.setElementAt(col.elementAt(2),0);

System.out.println(col);

}

}

A. Compilation error on line 1.

B. Only line 1 won't compile.

C. The code compiles and runs fine.

D. Prints [3.2, 2, 3.2, 2]

E. Prints [1, 2, 3.2, 2]

Select three correct statements.

A. A static method may override another static method.

B. A static method cannot override a non-static method.

C. A non-static method cannot override a static method.

D. A non-static method may be overloaded by a static method.

E. A synchronized method cannot be overridden.

Source: Contents are provided by Technicalsymposium Google Group Members.
Disclaimer: All the above contents are provided by technicalsymposium.com Google Group members.
Further, this content is not intended to be used for commercial purpose. Technicalsymposium.com is not liable/responsible for any copyright issues.


Government Jobs

All State and Central Government Jobs/Railway & Bank Jobs/Alll Competitive Exams-Complete Details.

Software Jobs

Entry Level Software & IT Jobs in Chennai/Bangalore & Leading Metro Cities-Complete Details.

Conference/Symposium

Engineering Colleges & University /Premier Institute (IIT/IIM/etc.,) Events Details.

Off-Campus/Walk-in

All Software Companies & Core Companies Off-Campus Interviews & Walk-in across India-Complete Details.

All Bank Jobs

All Government Bank & Private Bank Jobs-Complete Details.

Internships

All Companies Internships-Complete Details.

IBPS

Probationary Officers/Clerk and Management Trainees & All IBPS Exams/Syllabus-Complete Details.

GATE

All Branches Syllabus & Question Papers-Free Download.

IES-Exam

Indian Engineering Services Syllabus & Question.Papers-Complete Details.

Software Program

Top Programming Source Codes/Lab Manuals with Solutions-Complete Details

Anna University

B.E/B.Tech/M.E/M.Tech/MCA/MBA Latest Syllabus & Question Papers

Scholarships

All Central & State Govt Scholarships/ International Scholarships/Merit Scholarships Details.

Placement Papers

All Companies Placement Papers with Answers - Free Download of Materials

Aptitude

All Aptitude Test Topics with Answers-Complete Details & Free Download

Technical Round Interview

All Companies Technical Round Interview Asked Questions with Answers

Certifications

All Certifications Software & All Branches Certifications-Complete Details.

Group Discussion

Group Discussion Various Topics with Valid Points-Complete Details.

HR Round

All HR Round Questions and Answers/Tips & Do's and Don'ts of HR Round.

General Job

Job Interview Tips & Do's/Dont's/Dress Codes/Body Language-Complete Details.

Placement ebooks

All Companies Placement Materials with Answers-Complete Details.

Technical Round Tips

All Kind of Technical Round Interview Tips and Answers/ Do's and Don'ts

Resume

Resume Writing Tips/Do's & Don'ts-Complete Details.

Career Pages

All MNC Companies Career Pages & Current Openings-Complete Details.

Software Projects

All Software Projects with Source Codes-Free Download & Details.

GRE

GRE Exam Procedure and Complete Details.

TOEFL

TOEFL Exam Procedure and Complete Details.

IELTS

IELTS Exam Procedure and Complete Details

SAT

SAT Exam Procedure and Complete Details

GMAT

GMAT Exam Procedure and Complete Details

MS in USA

MS in USA Procedure and Complete Details

Civil Engineering

Civil Engineering Lecture Notes for All Universities & Lab Manuals for All Semester.-Free Download

Mechanical Engineering

Mechanical Engineering Lecture Notes for All Universities & Lab Manuals for All Semester-Free Download.

Automobile Engineering

Automobile Engineering Lecture Notes for All Universities & Lab Manuals for All Semester-Free Download.

Computer Science

Computer Science Lecture Notes for All Universities & Lab Manuals for All Semester-Free Download.

Information Technology

Information Technology Lecture Notes for All Universities & Lab Manuals for All Semester-Free Download.

MBA

MBA Lecture Notes for All Universities & Lab Manuals for All Semester-Free Download.

Biotechnology

Biotechnology Lecture Notes for All Universities & Lab Manuals for All Semester-Free Download.

Biomedical

Biomedical Lecture Notes for All Universities & Lab Manuals for All Semester-Free Download.

Aeronautical Engineering

Aeronautical Engineering Lecture Notes for All Universities & Lab Manuals for All Semester-Free Download

Chemical Engineering

Chemical Engineering Lecture Notes for All Universities & Lab Manuals for All Semester-Free Download.

Electronics & Communication

Electronics & Communication Engineering Lecture Notes for All Universities & Lab Manuals for All Semester-Free Download.

Electrical & Electronics

Electrical & Electronics Lecture Notes for All Universities & Lab Manuals for All Semester-Free Download.

MCA

MCA Lecture Notes for All Universities & Lab Manuals for All Semester-Free Download.

B.Sc

B.Sc All Branches (Maths/Physics/Computer Science/Electronics/etc.,)-Lecture Notes-Free Download

BCA

BCA Lecture Notes for All Universities & Lab Manuals for All Semester-Free Download.

BBA

BBA Lecture Notes for All Universities & Lab Manuals for All Semester-Free Download.

M.Sc

M.Sc All Branches (Maths/Physics/Computer Science/Electronics/etc.,)-Lecture Notes-Free Download

M.Com

M.Com Lecture Notes for All Universities & Lab Manuals for All Semester-Free Download.

Engineering Maths

All Semester Engineering Maths (M1/M2/M3/M4/etc.,) Lecture Notes-Free Download

Engineering EBooks

All Engineering Branches of ebooks Free Download-Complete Details.

Engineering Physics

All Semester Engineering Physics Lecture Notes-Free Download

GATE Preparation Books

All Branches of GATE Free Preparation eBooks-Free Download.

Engineering Chemistry

All Semester Engineering Chemistry Lecture Notes-Free Download

Software Companies Info

All Software Companies in India - Complete Details.

Admission

Foreign Universities All Course Admission Procedures-Complete Details.

Software Ebooks

All Programming Software free Eboooks-Free Download.

Web Hosting

All Web Hosting Procedure-Complete Details.