SlideShare a Scribd company logo
1 of 4
Both the methods sleep and join throws Interrupted Exception.
Select an answer
*A. TRUE
B. FALSE
This is a legal int x[]={2,3,7,9};
Select an answer
*A. TRUE
B. FALSE
Can you automatically convert a long to an int if the long value is small enough
to fit into an int?
Select an answer
A. Yes
*B. No
Collection will not represent a single unit of objects.
Select an answer
A. TRUE
*B. FALSE
By default, all program import the java.lang package.
Select an answer
*A. TRUE
B. FALSE
Is it legal to access a static method using an instance of an class?
Select an answer
A. Yes
*B. No
A method can have more than one access modifier?
Select an answer
*A. TRUE
B. FALSE
A source stream initiates the flow of data, also called an input stream.
Select an answer
*A. TRUE
B. FALSE
ou can pass an object reference as an argument to a method call.
Select an answer
*A. TRUE
B. FALSE
When you pass a variable an argument to a method is called.
Select an answer
*A. TRUE
B. FALSE
When a Java program tries to divide by zero; the runtime will create and throw
an object of Arithmetic Exception.
Select an answer
*A. TRUE
B. FALSE
An object means, anything that can D25be seen or touched; material thing.
Select an answer
*A. TRUE
B. FALSE
Suppose that Marketing is a subclass of Department. What is casting used for in
the code? public organize (Department sales) { Marketing marketing1 =
(Marketing) sales ; }
(Please select ALL that apply)
Select an answer
A. To cast sales to a Marketing reference
B. To convert a Department object into a Marketing object
C. To make the code clearer
*D. To perform a narrowing conversion
Which constructs can you make private?
(Please select ALL that apply)
Select an answer
A. Local variables
*B. Member variables
*C. Methods
*D. Top-level classes
A byte can be of what size?
Select an answer
*A. -128 to 127
B. (-2 power 8)-1 to 2 power 8
C. -255 to 256
D. Depends on the particular implementation of the Java Virtual machine
What is a constructor?
Select an answer
A. A constructor is a special kind of method that determines how a
class is initialized when created
B. A constructor is a special kind of class that determines how an
object is initialized when created
*C. A constructor is a special kind of method that determines how an
object is initialized when created
D. A constructor is a special kind of method that determines how a
message is
A ref is a:
Select an answer
*A. Method of passing the values of parameters
B. Pointer to an object
C. Method of compiling the PL/SQL
D. A wrapper for encrypting the source
E. None of the options are correct
Identify the best examples of an inheritance hierarchy.
(Please select ALL that apply)
Select an answer
A. Animal extends Dog extends Cat
*B. Cappuccino extends Coffee extends Beverage
C. Director extends Manager extends Employee
D. Vehicle extends Car
<p>What happens when you put this expression in your code? </p>int x=0; int y =
4%x;
Select an answer
*A. Compile time error
B. Compiles and runs
C. Runtime exception
Can we create one or more package declaration per source file?
Select an answer
A. Yes, specify multiple package declaration at starting of the program
*B. No you can have only one package declaration per file
C. Yes, you can use scope braces to show which package definition holds
good for respected blocks
D. None of the options are correct
You have a method that throws a checked exception. What is required to ensure
that the code correctly compiles and any potential exceptions are handled by all
callers to this method?
(Please select ALL that apply)
Select an answer
*A. The called method must be declared with a throws clause
*B. The calling method must either enclose the method call in a
try...catch block or declare the relevant exception to be thrown
C. The calling method must include a catch block for each specific type
of exception thrown by the called method
D. The calling method must override a method of a superclass
Suppose you have an abstract Vehicle class. The Ford class extends the Car
class, which extends the Vehicle class, and overrides its getSpec method. You
assign a Ford reference to a variable, vehicle, of type Vehicle. Which getSpec
method is called through vehicle? Vehicle a = new Ford(); a.getSpec();
Select an answer
A. The getSpec method of the Car object
*B. The getSpec method of the Ford object
C. The getSpec method of the Vehicle object
Suppose you needed to pass a variable number of integer arguments to the
newMethod method and have to make use of the varargs feature. Which statement is
syntactically correct?
Select an answer
A. static void newMethod ( intnumbr[] )
*B. static void newMethod ( int ... numbr )
C. static void newMethod ( int --- numbr )
D. static void newMethod ( boolean ... numbr )
The three basic read methods are:
(Please select ALL that apply)
Select an answer
A. int read([]char)
B. int read()
*C. int read(char[] cbuf)
*D. int read(char[] cbuf, int offset, int length
What is the work of java Runtime environment?
(Please select ALL that apply)
Select an answer
A. Creates code
B. Loads code
C. Verifies code
D. Executes code
*E. None of the options are correct
What will be the output of the program?
public class Foo
{
public static void main(String[] args)
{
try
{
return;
}
finally
{
System.out.println( "Finally" );
}
}
}
Select an answer
*A. Finally
B. Compilation fails.
C. The code runs with no output.
D. An exception is thrown at runtime.
Which three form part of correct array declarations?
(Please select ALL that apply)
Select an answer
*A. public int a [ ]
*B. static int [ ] a
*C. public [ ] int a
D. private int a [3]
E. private int [3] a [ ]
F. public final int [ ] a

More Related Content

What's hot

Polymorphism
PolymorphismPolymorphism
PolymorphismAmir Ali
 
Pinkle Makhijani ,BCA 2nd Year
Pinkle  Makhijani ,BCA 2nd YearPinkle  Makhijani ,BCA 2nd Year
Pinkle Makhijani ,BCA 2nd Yeardezyneecole
 
Rahul Saini, BCA 2nd Year
Rahul Saini, BCA 2nd YearRahul Saini, BCA 2nd Year
Rahul Saini, BCA 2nd Yeardezyneecole
 
Pointers,virtual functions and polymorphism cpp
Pointers,virtual functions and polymorphism cppPointers,virtual functions and polymorphism cpp
Pointers,virtual functions and polymorphism cpprajshreemuthiah
 
02 functions, variables, basic input and output of c++
02   functions, variables, basic input and output of c++02   functions, variables, basic input and output of c++
02 functions, variables, basic input and output of c++Manzoor ALam
 
Polymorphism and its types
Polymorphism and its typesPolymorphism and its types
Polymorphism and its typesSuraj Bora
 
Rakesh Bijawat, BCA 2nd Year
Rakesh Bijawat, BCA 2nd YearRakesh Bijawat, BCA 2nd Year
Rakesh Bijawat, BCA 2nd Yeardezyneecole
 
Rakesh Bijawat , BCA Third Year
Rakesh Bijawat , BCA Third YearRakesh Bijawat , BCA Third Year
Rakesh Bijawat , BCA Third YearDezyneecole
 
Kajal Gaharwal,BCA 2nd Year
Kajal Gaharwal,BCA 2nd YearKajal Gaharwal,BCA 2nd Year
Kajal Gaharwal,BCA 2nd Yeardezyneecole
 
Deepak Soni,BCA 2nd Year
Deepak Soni,BCA 2nd YearDeepak Soni,BCA 2nd Year
Deepak Soni,BCA 2nd Yeardezyneecole
 
Aanchal Gupta,BCA 2nd year
Aanchal Gupta,BCA 2nd yearAanchal Gupta,BCA 2nd year
Aanchal Gupta,BCA 2nd yeardezyneecole
 
Type casting in java
Type casting in javaType casting in java
Type casting in javaFarooq Baloch
 
Farhaan Ahmed, BCA 2nd Year
Farhaan Ahmed, BCA 2nd YearFarhaan Ahmed, BCA 2nd Year
Farhaan Ahmed, BCA 2nd Yeardezyneecole
 
Input and output in C++
Input and output in C++Input and output in C++
Input and output in C++Nilesh Dalvi
 
Ram Prasad ,BCA 2nd Year
Ram Prasad ,BCA 2nd YearRam Prasad ,BCA 2nd Year
Ram Prasad ,BCA 2nd Yeardezyneecole
 
งานย่อย 6
งานย่อย 6งานย่อย 6
งานย่อย 6Biw Nipawan
 

What's hot (19)

Functions
FunctionsFunctions
Functions
 
Polymorphism
PolymorphismPolymorphism
Polymorphism
 
Pinkle Makhijani ,BCA 2nd Year
Pinkle  Makhijani ,BCA 2nd YearPinkle  Makhijani ,BCA 2nd Year
Pinkle Makhijani ,BCA 2nd Year
 
Rahul Saini, BCA 2nd Year
Rahul Saini, BCA 2nd YearRahul Saini, BCA 2nd Year
Rahul Saini, BCA 2nd Year
 
Pointers,virtual functions and polymorphism cpp
Pointers,virtual functions and polymorphism cppPointers,virtual functions and polymorphism cpp
Pointers,virtual functions and polymorphism cpp
 
02 functions, variables, basic input and output of c++
02   functions, variables, basic input and output of c++02   functions, variables, basic input and output of c++
02 functions, variables, basic input and output of c++
 
Polymorphism and its types
Polymorphism and its typesPolymorphism and its types
Polymorphism and its types
 
Rakesh Bijawat, BCA 2nd Year
Rakesh Bijawat, BCA 2nd YearRakesh Bijawat, BCA 2nd Year
Rakesh Bijawat, BCA 2nd Year
 
Rakesh Bijawat , BCA Third Year
Rakesh Bijawat , BCA Third YearRakesh Bijawat , BCA Third Year
Rakesh Bijawat , BCA Third Year
 
Kajal Gaharwal,BCA 2nd Year
Kajal Gaharwal,BCA 2nd YearKajal Gaharwal,BCA 2nd Year
Kajal Gaharwal,BCA 2nd Year
 
Deepak Soni,BCA 2nd Year
Deepak Soni,BCA 2nd YearDeepak Soni,BCA 2nd Year
Deepak Soni,BCA 2nd Year
 
Aanchal Gupta,BCA 2nd year
Aanchal Gupta,BCA 2nd yearAanchal Gupta,BCA 2nd year
Aanchal Gupta,BCA 2nd year
 
Type casting in java
Type casting in javaType casting in java
Type casting in java
 
Farhaan Ahmed, BCA 2nd Year
Farhaan Ahmed, BCA 2nd YearFarhaan Ahmed, BCA 2nd Year
Farhaan Ahmed, BCA 2nd Year
 
Input and output in C++
Input and output in C++Input and output in C++
Input and output in C++
 
Ram Prasad ,BCA 2nd Year
Ram Prasad ,BCA 2nd YearRam Prasad ,BCA 2nd Year
Ram Prasad ,BCA 2nd Year
 
Code smells and remedies
Code smells and remediesCode smells and remedies
Code smells and remedies
 
งานย่อย 6
งานย่อย 6งานย่อย 6
งานย่อย 6
 
Type conversion
Type  conversionType  conversion
Type conversion
 

Viewers also liked

Viewers also liked (8)

Core Java
Core JavaCore Java
Core Java
 
Presentation on Core java
Presentation on Core javaPresentation on Core java
Presentation on Core java
 
Seminar on java
Seminar on javaSeminar on java
Seminar on java
 
Core java concepts
Core java  conceptsCore java  concepts
Core java concepts
 
Java Tutorial
Java TutorialJava Tutorial
Java Tutorial
 
Core java slides
Core java slidesCore java slides
Core java slides
 
Java tutorial PPT
Java tutorial PPTJava tutorial PPT
Java tutorial PPT
 
Core Java Slides
Core Java SlidesCore Java Slides
Core Java Slides
 

Similar to CORE JAVA

Goals1)Be able to work with individual bits in java.2).docx
Goals1)Be able to work with individual bits in java.2).docxGoals1)Be able to work with individual bits in java.2).docx
Goals1)Be able to work with individual bits in java.2).docxjosephineboon366
 
Consider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docxConsider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docxmaxinesmith73660
 
Prueba de conociemientos Fullsctack NET v2.docx
Prueba de conociemientos  Fullsctack NET v2.docxPrueba de conociemientos  Fullsctack NET v2.docx
Prueba de conociemientos Fullsctack NET v2.docxjairatuesta
 
Java căn bản - Chapter7
Java căn bản - Chapter7Java căn bản - Chapter7
Java căn bản - Chapter7Vince Vo
 
Developer Android Tools
Developer Android ToolsDeveloper Android Tools
Developer Android ToolsMacha DA COSTA
 
Chapter 7 - Defining Your Own Classes - Part II
Chapter 7 - Defining Your Own Classes - Part IIChapter 7 - Defining Your Own Classes - Part II
Chapter 7 - Defining Your Own Classes - Part IIEduardo Bergavera
 
Advanced programming topics asma
Advanced programming topics asmaAdvanced programming topics asma
Advanced programming topics asmaAbdullahJana
 
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
 
Comp 328 final guide
Comp 328 final guideComp 328 final guide
Comp 328 final guidekrtioplal
 
cppt-170218053903 (1).pptx
cppt-170218053903 (1).pptxcppt-170218053903 (1).pptx
cppt-170218053903 (1).pptxWatchDog13
 
Cmis 102 Effective Communication / snaptutorial.com
Cmis 102  Effective Communication / snaptutorial.comCmis 102  Effective Communication / snaptutorial.com
Cmis 102 Effective Communication / snaptutorial.comHarrisGeorg12
 

Similar to CORE JAVA (20)

Plsql
PlsqlPlsql
Plsql
 
Html
HtmlHtml
Html
 
Goals1)Be able to work with individual bits in java.2).docx
Goals1)Be able to work with individual bits in java.2).docxGoals1)Be able to work with individual bits in java.2).docx
Goals1)Be able to work with individual bits in java.2).docx
 
Consider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docxConsider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docx
 
Part - 2 Cpp programming Solved MCQ
Part - 2  Cpp programming Solved MCQ Part - 2  Cpp programming Solved MCQ
Part - 2 Cpp programming Solved MCQ
 
Express 070 536
Express 070 536Express 070 536
Express 070 536
 
Prueba de conociemientos Fullsctack NET v2.docx
Prueba de conociemientos  Fullsctack NET v2.docxPrueba de conociemientos  Fullsctack NET v2.docx
Prueba de conociemientos Fullsctack NET v2.docx
 
Java căn bản - Chapter7
Java căn bản - Chapter7Java căn bản - Chapter7
Java căn bản - Chapter7
 
Developer Android Tools
Developer Android ToolsDeveloper Android Tools
Developer Android Tools
 
Chapter 7 - Defining Your Own Classes - Part II
Chapter 7 - Defining Your Own Classes - Part IIChapter 7 - Defining Your Own Classes - Part II
Chapter 7 - Defining Your Own Classes - Part II
 
Advanced programming topics asma
Advanced programming topics asmaAdvanced programming topics asma
Advanced programming topics asma
 
Intake 37 2
Intake 37 2Intake 37 2
Intake 37 2
 
java tutorial 3
 java tutorial 3 java tutorial 3
java tutorial 3
 
Ppt of c vs c#
Ppt of c vs c#Ppt of c vs c#
Ppt of c vs c#
 
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
 
Comp 328 final guide
Comp 328 final guideComp 328 final guide
Comp 328 final guide
 
cppt-170218053903 (1).pptx
cppt-170218053903 (1).pptxcppt-170218053903 (1).pptx
cppt-170218053903 (1).pptx
 
Intake 38 2
Intake 38 2Intake 38 2
Intake 38 2
 
Java Generics
Java GenericsJava Generics
Java Generics
 
Cmis 102 Effective Communication / snaptutorial.com
Cmis 102  Effective Communication / snaptutorial.comCmis 102  Effective Communication / snaptutorial.com
Cmis 102 Effective Communication / snaptutorial.com
 

Recently uploaded

complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture designssuser87fa0c1
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 

Recently uploaded (20)

complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture design
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 

CORE JAVA

  • 1. Both the methods sleep and join throws Interrupted Exception. Select an answer *A. TRUE B. FALSE This is a legal int x[]={2,3,7,9}; Select an answer *A. TRUE B. FALSE Can you automatically convert a long to an int if the long value is small enough to fit into an int? Select an answer A. Yes *B. No Collection will not represent a single unit of objects. Select an answer A. TRUE *B. FALSE By default, all program import the java.lang package. Select an answer *A. TRUE B. FALSE Is it legal to access a static method using an instance of an class? Select an answer A. Yes *B. No A method can have more than one access modifier? Select an answer *A. TRUE B. FALSE A source stream initiates the flow of data, also called an input stream. Select an answer *A. TRUE B. FALSE ou can pass an object reference as an argument to a method call. Select an answer *A. TRUE B. FALSE When you pass a variable an argument to a method is called. Select an answer *A. TRUE B. FALSE When a Java program tries to divide by zero; the runtime will create and throw an object of Arithmetic Exception.
  • 2. Select an answer *A. TRUE B. FALSE An object means, anything that can D25be seen or touched; material thing. Select an answer *A. TRUE B. FALSE Suppose that Marketing is a subclass of Department. What is casting used for in the code? public organize (Department sales) { Marketing marketing1 = (Marketing) sales ; } (Please select ALL that apply) Select an answer A. To cast sales to a Marketing reference B. To convert a Department object into a Marketing object C. To make the code clearer *D. To perform a narrowing conversion Which constructs can you make private? (Please select ALL that apply) Select an answer A. Local variables *B. Member variables *C. Methods *D. Top-level classes A byte can be of what size? Select an answer *A. -128 to 127 B. (-2 power 8)-1 to 2 power 8 C. -255 to 256 D. Depends on the particular implementation of the Java Virtual machine What is a constructor? Select an answer A. A constructor is a special kind of method that determines how a class is initialized when created B. A constructor is a special kind of class that determines how an object is initialized when created *C. A constructor is a special kind of method that determines how an object is initialized when created D. A constructor is a special kind of method that determines how a message is A ref is a: Select an answer *A. Method of passing the values of parameters B. Pointer to an object C. Method of compiling the PL/SQL D. A wrapper for encrypting the source E. None of the options are correct Identify the best examples of an inheritance hierarchy. (Please select ALL that apply)
  • 3. Select an answer A. Animal extends Dog extends Cat *B. Cappuccino extends Coffee extends Beverage C. Director extends Manager extends Employee D. Vehicle extends Car <p>What happens when you put this expression in your code? </p>int x=0; int y = 4%x; Select an answer *A. Compile time error B. Compiles and runs C. Runtime exception Can we create one or more package declaration per source file? Select an answer A. Yes, specify multiple package declaration at starting of the program *B. No you can have only one package declaration per file C. Yes, you can use scope braces to show which package definition holds good for respected blocks D. None of the options are correct You have a method that throws a checked exception. What is required to ensure that the code correctly compiles and any potential exceptions are handled by all callers to this method? (Please select ALL that apply) Select an answer *A. The called method must be declared with a throws clause *B. The calling method must either enclose the method call in a try...catch block or declare the relevant exception to be thrown C. The calling method must include a catch block for each specific type of exception thrown by the called method D. The calling method must override a method of a superclass Suppose you have an abstract Vehicle class. The Ford class extends the Car class, which extends the Vehicle class, and overrides its getSpec method. You assign a Ford reference to a variable, vehicle, of type Vehicle. Which getSpec method is called through vehicle? Vehicle a = new Ford(); a.getSpec(); Select an answer A. The getSpec method of the Car object *B. The getSpec method of the Ford object C. The getSpec method of the Vehicle object Suppose you needed to pass a variable number of integer arguments to the newMethod method and have to make use of the varargs feature. Which statement is syntactically correct? Select an answer A. static void newMethod ( intnumbr[] ) *B. static void newMethod ( int ... numbr ) C. static void newMethod ( int --- numbr ) D. static void newMethod ( boolean ... numbr ) The three basic read methods are: (Please select ALL that apply) Select an answer A. int read([]char)
  • 4. B. int read() *C. int read(char[] cbuf) *D. int read(char[] cbuf, int offset, int length What is the work of java Runtime environment? (Please select ALL that apply) Select an answer A. Creates code B. Loads code C. Verifies code D. Executes code *E. None of the options are correct What will be the output of the program? public class Foo { public static void main(String[] args) { try { return; } finally { System.out.println( "Finally" ); } } } Select an answer *A. Finally B. Compilation fails. C. The code runs with no output. D. An exception is thrown at runtime. Which three form part of correct array declarations? (Please select ALL that apply) Select an answer *A. public int a [ ] *B. static int [ ] a *C. public [ ] int a D. private int a [3] E. private int [3] a [ ] F. public final int [ ] a