Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

Top 100 JAVA Interview Question & Answers

Rating
-
Sold
-
Pages
15
Grade
A+
Uploaded on
14-07-2024
Written in
2023/2024

Top 100 JAVA Interview Question & Answers

Institution
Course

Content preview

Top 100 Java Interview Questions & Answers

1. What is a class in Java?
Answer: Java encapsulates the codes in various classes which define new data types. These new data
types are used to create objects.



2. What is a JVM?
Answer: JVM is Java Virtual Machine which is a run time environment for the compiled java class files.



3. What is the right data type to represent a price in Java?
Answer: BigDecimal, if memory is not a concern and Performance, is not critical, otherwise double with
predefined precision.



4. Does Java support multiple inheritances?
Answer: Java doesn’t support multiple inheritances.



5. What are the supported platforms by Java Programming Language?
Answer: Java runs on a variety of platforms, such as Windows, Mac OS, and the various versions of
UNIX/Linux like HP-Unix, Sun Solaris, Red hat Linux, Ubuntu, Cent OS, etc.


6. List any five features of Java?
Answer: Some features include Object Oriented
Platform Independent
Robust
Interpreted
Multi-threaded


7. Explain method overloading?
Answer: When a Java program contains more than one methods with the same name but different
properties, then it is called method overloading.



8. What restrictions are placed on the location of a package statement within a source code file?
Answer: A package statement must appear as the first line in a source code file (eliminating blank lines
and comments).

, 9. What method is used to specify a container’s layout?
Answer: The setLayout() method is used to specify a container’s layout.



10. What is the immediate superclass of the Applet class?
Answer: The Panel class is the immediate superclass of the Applet class.


11. What are the access modifiers in Java?
Answer: There are 3 access modifiers. Public, protected and private, and the default one if no identifier
is specified is called friendly, but programmer cannot specify the friendly identifier explicitly.


12. What is are packages?
Answer: A package is a collection of related classes and interfaces providing access protection and
namespace management.


13. What is meant by Inheritance and What are its advantages?
Answer: Inheritance is the process of inheriting all the features from a class. The advantages of
inheritance are reusability of code and accessibility of variables and methods of the super class by
subclasses.


14. Can we rethrow the same exception from catch handler?
Answer: Yes, we can rethrow the same exception from our catch handler. If we want to rethrow
checked exception from a catch block we need to declare that exception.



15. what value is a variable of the String type automatically initialized?
Answer: The default value of a String type is null.



16. When a thread blocks on I/O, what state does it enter?
Answer: When it blocks on I/O, A thread enters the waiting state.



17. Which containers use a Flow Layout as their default layout?
Answer: The Panel and Applet classes use the Flow Layout as their default layout.



18. Explain Java Coding Standards for Constants ?
Answer:
Constants in java are created using static and final keywords.

Written for

Institution
Course

Document information

Uploaded on
July 14, 2024
Number of pages
15
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$10.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
rajeshrawat

Also available in package deal

Get to know the seller

Seller avatar
rajeshrawat Rajesh rawat
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
1 year
Number of followers
0
Documents
7
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions