SlideShare uma empresa Scribd logo
1 de 5
CORE JAVA
Duration :30 min
1. public class F0091
{
public void main( String[] args )
{
System.out.println( "Hello" + args[0] );
}
}
What will be the output of the program, if this code is executed with the command line:
> java F0091 world
A.Hello
B. Hello Foo91
C.Hello world
D.The code does not run.
2. What will be the output of the program ?
public class Test
{
public static void main(String [] args)
{
signed int x = 10;
for (int y=0; y<5; y++, x--)
System.out.print(x + ", ");
}
}
A.10, 9, 8, 7, 6,
B. 9, 8, 7, 6, 5,
C.Compilation fails.
D.An exception is thrown at runtime.
3. Which four options describe the correct default values for array elements of the types
indicated?
1. int -> 0
2. String -> "null"
3. Dog -> null
4. char -> 'u0000'
5. float -> 0.0f
6. boolean -> true
A.1, 2, 3, 4
B. 1, 3, 4, 5
C.2, 4, 5, 6
D.3, 4, 5, 6
4. Which is a reserved word in the Java programming language?
A.method
B. native
C.subclasses
D.reference
E. array
5. Which one of the following will declare an array and initialize it with five numbers?
A.Array a = new Array(5);
B. int [] a = {23,22,21,20,19};
C.int a [] = new int(5);
D.int [5] array;
6. Which is the valid declarations within an interface definition?
A.public double methoda();
B. public final double methoda();
C.static void methoda(double d1);
D.protected void methoda(double d1);
7. public class Test { }
What is the prototype of the default constructor?
A.Test( )
B. Test(void)
C.public Test( )
D.public Test(void)
8. Which cause a compiler error?
A.int[ ] scores = {3, 5, 7};
B. int [ ][ ] scores = {2,7,6}, {9,3,45};
C.String cats[ ] = {"Fluffy", "Spot", "Zeus"};
D.boolean results[ ] = new boolean [3] {true, false, true};
E. Integer results[ ] = {new Integer(3), new Integer(5), new Integer(8)};
9. Which of the following class level (nonlocal) variable declarations will not compile?
A.protected int a;
B. transient int b = 3;
C.public static final int c;
D.volatile int d;
E. private synchronized int e;
10. Given a method in a protected class, what access modifier do you use to restrict access to
that method to only the other members of the same class?
A.final
B. static
C.private
D.protected
E. volatile
11. Which two are true about a method-local inner class?
A.It must be marked final.
B. It can be marked abstract.
C.It can be marked public.
D.It can be marked static.
12. Which constructs an anonymous inner class instance?
A.Runnable r = new Runnable() { };
B. Runnable r = new Runnable(public void run() { });
C.Runnable r = new Runnable { public void run(){}};
D.System.out.println(new Runnable() {public void run() { }});
13. What will be the output of the program?
class Test
{
public static void main(String [] args)
{
Test p = new Test();
p.start();
}
void start()
{
boolean b1 = false;
boolean b2 = fix(b1);
System.out.println(b1 + " " + b2);
}
boolean fix(boolean b1)
{
b1 = true;
return b1;
}
}

A.true true
B. false true
C.true false
D.false false
14. Which two are true about a method-local inner class?
A. It must be marked final.
B. It can be marked abstract.
C. It can be marked public.
D.It can be marked static.
15.
public class While
{
public void loop()
{
int x= 0;
while ( 1 ) /* Line 6 */
{
System.out.print("x plus one is " + (x + 1)); /* Line 8
*/
}
}
}
Which statement is true?
A.There is a syntax error on line 1.
B. There are syntax errors on lines 1 and 6.
C. There are syntax errors on lines 1, 6, and 8.
D.There is a syntax error on line 6.
16. What will be the output of the program?
public class Switch2
{
final static short x = 2;
public static int y = 0;
public static void main(String [] args)
{
for (int z=0; z < 3; z++)
{
switch (z)
{
case x: System.out.print("0 ");
case x-1: System.out.print("1 ");
case x-2: System.out.print("2 ");
}
}
}
}
A.0 1 2
B. 0 1 2 1 2 2
C. 2 1 0 1 0 0
D.2 1 2 0 1 2
17. Which of the following are legal lines of code?
1. int w = (int)888.8;
2. byte x = (byte)1000L;
3. long y = (byte)100;
4. byte z = (byte)100L;
A.1 and 2
B. 2 and 3
C. 3 and 4
D.All statements are correct.
18. Which two statements are true about wrapper or String classes?
1. If x and y refer to instances of different wrapper classes, then the fragment x.equals(y)
will cause a compiler failure.
2. If x and y refer to instances of different wrapper classes, then x == y can sometimes be
true.
3. If x and y are String references and if x.equals(y) is true, then x == y is true.
4. If x, y, and z refer to instances of wrapper classes and x.equals(y) is true, and y.equals(z)
is true, then z.equals(x) will always be true.
5. If x and y are String references and x == y is true, then y.equals(x) will be true.
A.1 and 2
B. 2 and 3
C. 3 and 4
D.4 and 5
19. class A
{
A( ) { }
}
class B extends A
{ }
Which statement is true?
A.Class B'S constructor is public.
B. Class B'S constructor has no arguments.
C. Class B'S constructor includes a call to this( ).
D.None of these.
20. What will be the output of the program?
try
{
int x = 0;
int y = 5 / x;
}
catch (Exception e)
{
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

Mais conteúdo relacionado

Mais procurados

Java Questioner for
Java Questioner for Java Questioner for
Java Questioner for Abhay Korat
 
Data Structure in C (Lab Programs)
Data Structure in C (Lab Programs)Data Structure in C (Lab Programs)
Data Structure in C (Lab Programs)Saket Pathak
 
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2Knowledge Center Computer
 
Computer Science Sample Paper 2015
Computer Science Sample Paper 2015Computer Science Sample Paper 2015
Computer Science Sample Paper 2015Poonam Chopra
 
CBSE Question Paper Computer Science with C++ 2011
CBSE Question Paper Computer Science with C++ 2011CBSE Question Paper Computer Science with C++ 2011
CBSE Question Paper Computer Science with C++ 2011Deepak Singh
 
Java level 1 Quizzes
Java level 1 QuizzesJava level 1 Quizzes
Java level 1 QuizzesSteven Luo
 
C multiple choice questions and answers pdf
C multiple choice questions and answers pdfC multiple choice questions and answers pdf
C multiple choice questions and answers pdfchoconyeuquy
 
Technical aptitude test 2 CSE
Technical aptitude test 2 CSETechnical aptitude test 2 CSE
Technical aptitude test 2 CSESujata Regoti
 
Technical aptitude Test 1 CSE
Technical aptitude Test 1 CSETechnical aptitude Test 1 CSE
Technical aptitude Test 1 CSESujata Regoti
 
Sample Question Paper IP Class xii
Sample Question Paper IP Class xii Sample Question Paper IP Class xii
Sample Question Paper IP Class xii kvs
 
Redo midterm
Redo midtermRedo midterm
Redo midtermIIUM
 
200 mcq c++(Ankit dubey)
200 mcq c++(Ankit dubey)200 mcq c++(Ankit dubey)
200 mcq c++(Ankit dubey)Ankit Dubey
 
important C questions and_answers praveensomesh
important C questions and_answers praveensomeshimportant C questions and_answers praveensomesh
important C questions and_answers praveensomeshpraveensomesh
 

Mais procurados (19)

Java Quiz
Java QuizJava Quiz
Java Quiz
 
CBSE Sample Paper IP
CBSE Sample Paper IPCBSE Sample Paper IP
CBSE Sample Paper IP
 
Quiz test JDBC
Quiz test JDBCQuiz test JDBC
Quiz test JDBC
 
Java Questioner for
Java Questioner for Java Questioner for
Java Questioner for
 
Part - 2 Cpp programming Solved MCQ
Part - 2  Cpp programming Solved MCQ Part - 2  Cpp programming Solved MCQ
Part - 2 Cpp programming Solved MCQ
 
Data Structure in C (Lab Programs)
Data Structure in C (Lab Programs)Data Structure in C (Lab Programs)
Data Structure in C (Lab Programs)
 
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
 
Computer Science Sample Paper 2015
Computer Science Sample Paper 2015Computer Science Sample Paper 2015
Computer Science Sample Paper 2015
 
CBSE Question Paper Computer Science with C++ 2011
CBSE Question Paper Computer Science with C++ 2011CBSE Question Paper Computer Science with C++ 2011
CBSE Question Paper Computer Science with C++ 2011
 
Computer science sqp
Computer science sqpComputer science sqp
Computer science sqp
 
Java level 1 Quizzes
Java level 1 QuizzesJava level 1 Quizzes
Java level 1 Quizzes
 
C multiple choice questions and answers pdf
C multiple choice questions and answers pdfC multiple choice questions and answers pdf
C multiple choice questions and answers pdf
 
Technical aptitude test 2 CSE
Technical aptitude test 2 CSETechnical aptitude test 2 CSE
Technical aptitude test 2 CSE
 
Technical aptitude Test 1 CSE
Technical aptitude Test 1 CSETechnical aptitude Test 1 CSE
Technical aptitude Test 1 CSE
 
Sample Question Paper IP Class xii
Sample Question Paper IP Class xii Sample Question Paper IP Class xii
Sample Question Paper IP Class xii
 
Redo midterm
Redo midtermRedo midterm
Redo midterm
 
200 mcq c++(Ankit dubey)
200 mcq c++(Ankit dubey)200 mcq c++(Ankit dubey)
200 mcq c++(Ankit dubey)
 
important C questions and_answers praveensomesh
important C questions and_answers praveensomeshimportant C questions and_answers praveensomesh
important C questions and_answers praveensomesh
 
Sample paper i.p
Sample paper i.pSample paper i.p
Sample paper i.p
 

Destaque

Capitulo 2 leer y escribir en la escuela -Delia Lerner
Capitulo 2 leer y escribir en la escuela -Delia LernerCapitulo 2 leer y escribir en la escuela -Delia Lerner
Capitulo 2 leer y escribir en la escuela -Delia LernerRosangel Soto
 
Fisp laços de cabos de aço aricabos
Fisp laços de cabos de aço aricabosFisp laços de cabos de aço aricabos
Fisp laços de cabos de aço aricabosGustavo Cassiolato
 
Tópico 1 – Iniciando No Empreendedorismo Tecnológico
Tópico 1 – Iniciando No Empreendedorismo TecnológicoTópico 1 – Iniciando No Empreendedorismo Tecnológico
Tópico 1 – Iniciando No Empreendedorismo TecnológicoJacques Chicourel
 
C-CAT Exam Laptop Configuration
C-CAT Exam Laptop ConfigurationC-CAT Exam Laptop Configuration
C-CAT Exam Laptop Configurationprabhatjon
 
Ronnie Lee Jr's DD-214 Military Document
Ronnie Lee Jr's DD-214 Military DocumentRonnie Lee Jr's DD-214 Military Document
Ronnie Lee Jr's DD-214 Military DocumentRonnie Lee
 
Operating system and C++ paper for CCEE
Operating system and C++ paper for CCEEOperating system and C++ paper for CCEE
Operating system and C++ paper for CCEEprabhatjon
 
Leer y escribir en la escuela - Delia Lerner
Leer y escribir en la escuela - Delia LernerLeer y escribir en la escuela - Delia Lerner
Leer y escribir en la escuela - Delia LernerPedro López Eiroá
 

Destaque (11)

Capitulo 2 leer y escribir en la escuela -Delia Lerner
Capitulo 2 leer y escribir en la escuela -Delia LernerCapitulo 2 leer y escribir en la escuela -Delia Lerner
Capitulo 2 leer y escribir en la escuela -Delia Lerner
 
Mustansir_Lokhandwala_CCR
Mustansir_Lokhandwala_CCRMustansir_Lokhandwala_CCR
Mustansir_Lokhandwala_CCR
 
act 5to d
act 5to dact 5to d
act 5to d
 
Fisp laços de cabos de aço aricabos
Fisp laços de cabos de aço aricabosFisp laços de cabos de aço aricabos
Fisp laços de cabos de aço aricabos
 
Tópico 1 – Iniciando No Empreendedorismo Tecnológico
Tópico 1 – Iniciando No Empreendedorismo TecnológicoTópico 1 – Iniciando No Empreendedorismo Tecnológico
Tópico 1 – Iniciando No Empreendedorismo Tecnológico
 
Ccpp pune
Ccpp puneCcpp pune
Ccpp pune
 
C-CAT Exam Laptop Configuration
C-CAT Exam Laptop ConfigurationC-CAT Exam Laptop Configuration
C-CAT Exam Laptop Configuration
 
Lengua y cultura
Lengua y culturaLengua y cultura
Lengua y cultura
 
Ronnie Lee Jr's DD-214 Military Document
Ronnie Lee Jr's DD-214 Military DocumentRonnie Lee Jr's DD-214 Military Document
Ronnie Lee Jr's DD-214 Military Document
 
Operating system and C++ paper for CCEE
Operating system and C++ paper for CCEEOperating system and C++ paper for CCEE
Operating system and C++ paper for CCEE
 
Leer y escribir en la escuela - Delia Lerner
Leer y escribir en la escuela - Delia LernerLeer y escribir en la escuela - Delia Lerner
Leer y escribir en la escuela - Delia Lerner
 

Semelhante a Core java

Java language fundamentals
Java language fundamentalsJava language fundamentals
Java language fundamentalsKapish Joshi
 
Indus Valley Partner aptitude questions and answers
Indus Valley Partner aptitude questions and answersIndus Valley Partner aptitude questions and answers
Indus Valley Partner aptitude questions and answersSushant Choudhary
 
Conceitos Fundamentais de Orientação a Objetos
Conceitos Fundamentais de Orientação a ObjetosConceitos Fundamentais de Orientação a Objetos
Conceitos Fundamentais de Orientação a Objetosguest22a621
 
Fnt software solutions placement paper
Fnt software solutions placement paperFnt software solutions placement paper
Fnt software solutions placement paperfntsofttech
 
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...Udayan Khattry
 
2 object orientation-copy
2 object orientation-copy2 object orientation-copy
2 object orientation-copyJoel Campos
 
Scjp questions
Scjp questionsScjp questions
Scjp questionsroudhran
 
1z0 851 exam-java standard edition 6 programmer certified professional
1z0 851 exam-java standard edition 6 programmer certified professional1z0 851 exam-java standard edition 6 programmer certified professional
1z0 851 exam-java standard edition 6 programmer certified professionalIsabella789
 
Chapter i(introduction to java)
Chapter i(introduction to java)Chapter i(introduction to java)
Chapter i(introduction to java)Chhom Karath
 
Java Questions and Answers
Java Questions and AnswersJava Questions and Answers
Java Questions and AnswersRumman Ansari
 
Java Questions
Java QuestionsJava Questions
Java Questionsbindur87
 

Semelhante a Core java (20)

Java language fundamentals
Java language fundamentalsJava language fundamentals
Java language fundamentals
 
Indus Valley Partner aptitude questions and answers
Indus Valley Partner aptitude questions and answersIndus Valley Partner aptitude questions and answers
Indus Valley Partner aptitude questions and answers
 
Conceitos Fundamentais de Orientação a Objetos
Conceitos Fundamentais de Orientação a ObjetosConceitos Fundamentais de Orientação a Objetos
Conceitos Fundamentais de Orientação a Objetos
 
Questões de Certificação SCJP
Questões de Certificação SCJPQuestões de Certificação SCJP
Questões de Certificação SCJP
 
7
77
7
 
Java Inheritance
Java InheritanceJava Inheritance
Java Inheritance
 
Fnt software solutions placement paper
Fnt software solutions placement paperFnt software solutions placement paper
Fnt software solutions placement paper
 
1
11
1
 
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
 
2 object orientation-copy
2 object orientation-copy2 object orientation-copy
2 object orientation-copy
 
Scjp questions
Scjp questionsScjp questions
Scjp questions
 
Scjp6.0
Scjp6.0Scjp6.0
Scjp6.0
 
FSOFT - Test Java Exam
FSOFT - Test Java ExamFSOFT - Test Java Exam
FSOFT - Test Java Exam
 
E5
E5E5
E5
 
1z0 851 exam-java standard edition 6 programmer certified professional
1z0 851 exam-java standard edition 6 programmer certified professional1z0 851 exam-java standard edition 6 programmer certified professional
1z0 851 exam-java standard edition 6 programmer certified professional
 
Java concurrency questions and answers
Java concurrency questions and answers Java concurrency questions and answers
Java concurrency questions and answers
 
Chapter i(introduction to java)
Chapter i(introduction to java)Chapter i(introduction to java)
Chapter i(introduction to java)
 
Java Questions and Answers
Java Questions and AnswersJava Questions and Answers
Java Questions and Answers
 
sample_midterm.pdf
sample_midterm.pdfsample_midterm.pdf
sample_midterm.pdf
 
Java Questions
Java QuestionsJava Questions
Java Questions
 

Mais de prabhatjon

Registration open for CCDAC AUG 2015 batch
Registration open for CCDAC AUG 2015 batchRegistration open for CCDAC AUG 2015 batch
Registration open for CCDAC AUG 2015 batchprabhatjon
 
Some other Importent Question (Mix)
Some other Importent Question (Mix)Some other Importent Question (Mix)
Some other Importent Question (Mix)prabhatjon
 
Some question for Section C (Embeded )
Some question for Section C (Embeded )Some question for Section C (Embeded )
Some question for Section C (Embeded )prabhatjon
 
CCAT Aug 2013 paper
CCAT Aug 2013 paperCCAT Aug 2013 paper
CCAT Aug 2013 paperprabhatjon
 
Instructions to candidates For DASDM
Instructions to candidates For DASDMInstructions to candidates For DASDM
Instructions to candidates For DASDMprabhatjon
 
Critical Aptitude Question
Critical Aptitude QuestionCritical Aptitude Question
Critical Aptitude Questionprabhatjon
 
Delta final paper
Delta final paperDelta final paper
Delta final paperprabhatjon
 
Diploma in Advanced Software Development Methodologies (DASDM)
Diploma in Advanced Software Development Methodologies  (DASDM)Diploma in Advanced Software Development Methodologies  (DASDM)
Diploma in Advanced Software Development Methodologies (DASDM)prabhatjon
 
Noida placement comp
Noida placement compNoida placement comp
Noida placement compprabhatjon
 
New Address of CDAC
New Address of CDACNew Address of CDAC
New Address of CDACprabhatjon
 
Course summary@bytes
Course summary@bytesCourse summary@bytes
Course summary@bytesprabhatjon
 
Admission booklet pg diploma courses cdac-v4
Admission booklet pg diploma courses cdac-v4Admission booklet pg diploma courses cdac-v4
Admission booklet pg diploma courses cdac-v4prabhatjon
 
Pg dst admissions-list
Pg dst admissions-listPg dst admissions-list
Pg dst admissions-listprabhatjon
 
List of companies visited Aug 2012 batch
List of companies visited Aug 2012 batchList of companies visited Aug 2012 batch
List of companies visited Aug 2012 batchprabhatjon
 
New added syllabus in ditiss by aug 2013 batch
New added syllabus in ditiss by aug 2013 batchNew added syllabus in ditiss by aug 2013 batch
New added syllabus in ditiss by aug 2013 batchprabhatjon
 
Dasdm advanced software development methodologies
Dasdm advanced software development methodologiesDasdm advanced software development methodologies
Dasdm advanced software development methodologiesprabhatjon
 

Mais de prabhatjon (20)

Registration open for CCDAC AUG 2015 batch
Registration open for CCDAC AUG 2015 batchRegistration open for CCDAC AUG 2015 batch
Registration open for CCDAC AUG 2015 batch
 
Oops Paper
Oops PaperOops Paper
Oops Paper
 
Some other Importent Question (Mix)
Some other Importent Question (Mix)Some other Importent Question (Mix)
Some other Importent Question (Mix)
 
Some question for Section C (Embeded )
Some question for Section C (Embeded )Some question for Section C (Embeded )
Some question for Section C (Embeded )
 
Os paper
Os paperOs paper
Os paper
 
CCAT Aug 2013 paper
CCAT Aug 2013 paperCCAT Aug 2013 paper
CCAT Aug 2013 paper
 
Instructions to candidates For DASDM
Instructions to candidates For DASDMInstructions to candidates For DASDM
Instructions to candidates For DASDM
 
Dsda
DsdaDsda
Dsda
 
Critical Aptitude Question
Critical Aptitude QuestionCritical Aptitude Question
Critical Aptitude Question
 
Cyber law ipc
Cyber law ipcCyber law ipc
Cyber law ipc
 
Delta final paper
Delta final paperDelta final paper
Delta final paper
 
Diploma in Advanced Software Development Methodologies (DASDM)
Diploma in Advanced Software Development Methodologies  (DASDM)Diploma in Advanced Software Development Methodologies  (DASDM)
Diploma in Advanced Software Development Methodologies (DASDM)
 
Noida placement comp
Noida placement compNoida placement comp
Noida placement comp
 
New Address of CDAC
New Address of CDACNew Address of CDAC
New Address of CDAC
 
Course summary@bytes
Course summary@bytesCourse summary@bytes
Course summary@bytes
 
Admission booklet pg diploma courses cdac-v4
Admission booklet pg diploma courses cdac-v4Admission booklet pg diploma courses cdac-v4
Admission booklet pg diploma courses cdac-v4
 
Pg dst admissions-list
Pg dst admissions-listPg dst admissions-list
Pg dst admissions-list
 
List of companies visited Aug 2012 batch
List of companies visited Aug 2012 batchList of companies visited Aug 2012 batch
List of companies visited Aug 2012 batch
 
New added syllabus in ditiss by aug 2013 batch
New added syllabus in ditiss by aug 2013 batchNew added syllabus in ditiss by aug 2013 batch
New added syllabus in ditiss by aug 2013 batch
 
Dasdm advanced software development methodologies
Dasdm advanced software development methodologiesDasdm advanced software development methodologies
Dasdm advanced software development methodologies
 

Último

How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdfssuserdda66b
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 

Último (20)

How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 

Core java

  • 1. CORE JAVA Duration :30 min 1. public class F0091 { public void main( String[] args ) { System.out.println( "Hello" + args[0] ); } } What will be the output of the program, if this code is executed with the command line: > java F0091 world A.Hello B. Hello Foo91 C.Hello world D.The code does not run. 2. What will be the output of the program ? public class Test { public static void main(String [] args) { signed int x = 10; for (int y=0; y<5; y++, x--) System.out.print(x + ", "); } } A.10, 9, 8, 7, 6, B. 9, 8, 7, 6, 5, C.Compilation fails. D.An exception is thrown at runtime. 3. Which four options describe the correct default values for array elements of the types indicated? 1. int -> 0 2. String -> "null" 3. Dog -> null 4. char -> 'u0000' 5. float -> 0.0f 6. boolean -> true A.1, 2, 3, 4 B. 1, 3, 4, 5 C.2, 4, 5, 6 D.3, 4, 5, 6 4. Which is a reserved word in the Java programming language? A.method B. native C.subclasses D.reference E. array 5. Which one of the following will declare an array and initialize it with five numbers? A.Array a = new Array(5); B. int [] a = {23,22,21,20,19}; C.int a [] = new int(5); D.int [5] array; 6. Which is the valid declarations within an interface definition?
  • 2. A.public double methoda(); B. public final double methoda(); C.static void methoda(double d1); D.protected void methoda(double d1); 7. public class Test { } What is the prototype of the default constructor? A.Test( ) B. Test(void) C.public Test( ) D.public Test(void) 8. Which cause a compiler error? A.int[ ] scores = {3, 5, 7}; B. int [ ][ ] scores = {2,7,6}, {9,3,45}; C.String cats[ ] = {"Fluffy", "Spot", "Zeus"}; D.boolean results[ ] = new boolean [3] {true, false, true}; E. Integer results[ ] = {new Integer(3), new Integer(5), new Integer(8)}; 9. Which of the following class level (nonlocal) variable declarations will not compile? A.protected int a; B. transient int b = 3; C.public static final int c; D.volatile int d; E. private synchronized int e; 10. Given a method in a protected class, what access modifier do you use to restrict access to that method to only the other members of the same class? A.final B. static C.private D.protected E. volatile 11. Which two are true about a method-local inner class? A.It must be marked final. B. It can be marked abstract. C.It can be marked public. D.It can be marked static. 12. Which constructs an anonymous inner class instance? A.Runnable r = new Runnable() { }; B. Runnable r = new Runnable(public void run() { }); C.Runnable r = new Runnable { public void run(){}}; D.System.out.println(new Runnable() {public void run() { }}); 13. What will be the output of the program? class Test { public static void main(String [] args) { Test p = new Test(); p.start(); } void start() { boolean b1 = false; boolean b2 = fix(b1); System.out.println(b1 + " " + b2); } boolean fix(boolean b1) {
  • 3. b1 = true; return b1; } } A.true true B. false true C.true false D.false false 14. Which two are true about a method-local inner class? A. It must be marked final. B. It can be marked abstract. C. It can be marked public. D.It can be marked static. 15. public class While { public void loop() { int x= 0; while ( 1 ) /* Line 6 */ { System.out.print("x plus one is " + (x + 1)); /* Line 8 */ } } } Which statement is true? A.There is a syntax error on line 1. B. There are syntax errors on lines 1 and 6. C. There are syntax errors on lines 1, 6, and 8. D.There is a syntax error on line 6. 16. What will be the output of the program? public class Switch2 { final static short x = 2; public static int y = 0; public static void main(String [] args) { for (int z=0; z < 3; z++) { switch (z) { case x: System.out.print("0 "); case x-1: System.out.print("1 "); case x-2: System.out.print("2 "); } } }
  • 4. } A.0 1 2 B. 0 1 2 1 2 2 C. 2 1 0 1 0 0 D.2 1 2 0 1 2 17. Which of the following are legal lines of code? 1. int w = (int)888.8; 2. byte x = (byte)1000L; 3. long y = (byte)100; 4. byte z = (byte)100L; A.1 and 2 B. 2 and 3 C. 3 and 4 D.All statements are correct. 18. Which two statements are true about wrapper or String classes? 1. If x and y refer to instances of different wrapper classes, then the fragment x.equals(y) will cause a compiler failure. 2. If x and y refer to instances of different wrapper classes, then x == y can sometimes be true. 3. If x and y are String references and if x.equals(y) is true, then x == y is true. 4. If x, y, and z refer to instances of wrapper classes and x.equals(y) is true, and y.equals(z) is true, then z.equals(x) will always be true. 5. If x and y are String references and x == y is true, then y.equals(x) will be true. A.1 and 2 B. 2 and 3 C. 3 and 4 D.4 and 5 19. class A { A( ) { } } class B extends A { } Which statement is true? A.Class B'S constructor is public. B. Class B'S constructor has no arguments. C. Class B'S constructor includes a call to this( ). D.None of these. 20. What will be the output of the program? try { int x = 0; int y = 5 / x; } catch (Exception e) { System.out.println("Exception"); }
  • 5. catch (ArithmeticException ae) { System.out.println(" Arithmetic Exception"); } System.out.println("finished"); A.finished B. Exception C. Compilation fails. D.Arithmetic Exception