Vous êtes sur la page 1sur 4

Java- error finding questions Part-I | Way 2 Freshers

Way 2 FreshersHomeCommunity ForumsLoansScholarshipsJobsPlacement


PapersAdvertiseRecent ArticlesCSVTU PTDC 8th Semester Regular Exam Result 2010
| CSVTU PTDC 8th Semester Backlog Result 2010 | Chhattisgarh Swami Vivekananda
Technical University PTDC Result 2010Ignou-Unesco Science Olympiad Program
Class X Mathematics Syllabus | Ignou-Unesco Science Olympiad Exam Class X
Mathematics SyllabusCalicut University M.A. Sanskrit II Semester Exam Result
2010 | University of Calicut M.Sc. Statistics IV Semester Exam Result 2010 |
www.universityofcalicut.infoIgnou-Unesco Science Olympiad Program Class X
Science Syllabus | Ignou-Unesco Science Olympiad Program Class X SyllabusLBS
Centre for Science and Technology 3rd Allotment Result 2010 | LBS Centre for
Science and Technology Counselling 3rd Allotment Result 2010 |
www.lbscentre.orgKSOU Mysore BA/BCom 1st,2nd and 3rd Year Examination Result
2010 | KSOU Mysore UG Arts Examination Rsult June 2010 |
www.ksoumysore.comKGSG Bank Recruitment Online Application Forms | Kashi Gomti
Samyut Gramin Bank Recruitment Online Application Forms 2010 |
www.kgsgbank.co.inIgnou-Unesco Science Olympiad Program Class IX Math
SyllabusTNPSC Village Administrative Officer Examination Syllabus | TNPSC VAO
Examination Syllabus | Tamil Nadu VAO Examination SyllabusIGNOU-UNESCO Science

Olympiad Class IX Science Syllabus | IGNOU-UNESCO Science Olympiad Class IX


SyllabusIGNOU Science Olympiad Test Pattern | IGNOU-UNESCO Science Olympiad
Test 2010 SchemeUtkal University of Culture Examination Results 2010 | Utkal
University MSW Part I / II Examination Result | www.utkal-university.orgSV
University LLB June 2010 Examination Results | SVU LLB June 2010 Examination
Result | SVU LLB Exam Result June 2010 | www.svuniversity.inCSBC Bihar Police
Results (Part-2) of written Examination for Current Vacancy | CSBC Bihar
Police Part-2 Written Exam Result 2010 | www.csbc.bih.nic.inJKBOSE Bi-Annual
2009 (winter zone) Class 10th Result | Jammu and Kasmir Board Bi-Annual 2009
Class 10th Result | www.jkbose.co.inTranslator
Java- error finding questions Part-I
By admin on May 23rd, 2008 Read this page in hindi
What is the result of executing the following Java class:
import java.awt.*;
public class FrameTest extends Frame {
public FrameTest() {
add (new Button("First"));
add (new Button("Second"));
add (new Button("Third"));
pack();
setVisible(true);
}
public static void main(String args []) {
new FrameTest();
}
}1) Nothing happens.
2) Three buttons are displayed across a window.
3) A runtime exception is generated (no layout manager specified).
4) Only the “first” button is displayed.
5) Only the “second” button is displayed.
6) Only the “third” button is displayed.
Answer : 6
Consider the following tags and attributes of tags, which can be used with the
and tags?
1. CODEBASE
2. ALT
3. NAME
4. CLASS
5. JAVAC
6. HORIZONTALSPACE
7. VERTICALSPACE
8. WIDTH
9. PARAM
10. JAR
(multiple)
1) line 1, 2, 3
2) line 2, 5, 6, 7
3) line 3, 4, 5
4) line 8, 9, 10
5) line 8, 9
Answer : 1,5
Which of the following is a legal way to construct a RandomAccessFile:
1) RandomAccessFile(“data”, “r”);
2) RandomAccessFile(“r”, “data”);
3) RandomAccessFile(“data”, “read”);
4) RandomAccessFile(“read”, “data”);
Answer : 1
Carefully examine the following code, When will the string “Hi there” be
printed?
public class StaticTest {
static {
System.out.println("Hi there");
}
public void print() {
System.out.println("Hello");
}
public static void main(String args []) {
StaticTest st1 = new StaticTest();
st1.print();
StaticTest st2 = new StaticTest();
st2.print();
}
}1) Never.
2) Each time a new instance is created.
3) Once when the class is first loaded into the Java virtual machine.
4) Only when the static method is called explicitly.
Answer : 3
What is the result of the following program:
public class Test {
public static void main (String args []) {
boolean a = false;
if (a = true)
System.out.println("Hello");
else
System.out.println("Goodbye");
}
}1) Program produces no output but terminates correctly.
2) Program does not terminate.
3) Prints out “Hello”
4) Prints out “Goodbye”
Answer : 3
Examine the following code, it includes an inner class, what is the result:
public final class Test4 {
class Inner {
void test() {
if (Test4.this.flag); {
sample();
}
}
}
private boolean flag = true;
public void sample() {
System.out.println("Sample");
}
public Test4() {
(new Inner()).test();
}
public static void main(String args []) {
new Test4();
}
}1) Prints out “Sample”
2) Program produces no output but terminates correctly.
3) Program does not terminate.
4) The program will not compile
Answer : 1
Carefully examine the following class:
public class Test5 {
public static void main (String args []) {
/* This is the start of a comment
if (true) {
Test5 = new test5();
System.out.println("Done the test");
}
/* This is another comment */
System.out.println ("The end");
}
}1) Prints out “Done the test” and nothing else.
2) Program produces no output but terminates correctly.
3) Program does not terminate.
4) The program will not compile.
5) The program generates a runtime exception.
6) The program prints out “The end” and nothing else.
7) The program prints out “Done the test” and “The end”
Answer : 6
Categories: fundamental questions
Tags: core java interview questions, java, java application oriented questions,
java aptitude questions, java basic faq, Java Basic Interview Questions &
Answers, java coding questions, java error finding questions, java freshers
questions, java interview questions, java programmitical qustions, java
technical questions« Java-Programitical questions, logical questions,technical
questions part-II Java-Technical questions on Utility Package »Related Articles
Java-Programitical questions, logical questions,technical questions
part-IIJava- Programmitical questions, logical questionsAMITI PAPER- APR
2007-BANGLOREAMITI TECHNOLOGIES PAPER – 18 OCT 2007C# Interview
Questions(51-60)Leave a Reply
If you have any questions headover to our forumsClick here to cancel reply.
Name Required
Email (not published) Required
Change this picture

You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym
title=""> <blockquote cite=""> <code> <em> <strong>HomeAsk QuestionsAbout
usAdvertiseContact usSubmit PaperSitemapPrivacy PolicyCopyright © 2010 Way 2
Freshers Powered by Lorvent All Rights Reserved. Reproduction without explicit
permission is prohibited.

Vous aimerez peut-être aussi