Location via proxy:
[ UP ]
[Report a bug]
[Manage cookies]
No cookies
No scripts
No ads
No referrer
Show this form
Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
6 views
Top 34 Java Basic Interview Question Answers
Java interview questions
Uploaded by
Mr fresh Asian
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Top 34 Java Basic Interview Question Answers For Later
Download
Save
Save Top 34 Java Basic Interview Question Answers For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
6 views
Top 34 Java Basic Interview Question Answers
Java interview questions
Uploaded by
Mr fresh Asian
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Top 34 Java Basic Interview Question Answers For Later
Carousel Previous
Carousel Next
Save
Save Top 34 Java Basic Interview Question Answers For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 7
Search
Fullscreen
1. What is Java? | © (Java is a high-level, object-oriented programming \designed to have minimal implementation dependencies, language developed by Sun Microsystems in 1995. It's making it platform- independent. 2. What is the JDK? ° |The JDK (Java Development Kit) is a software development lenvironment used for developing Java applications. It lincludes the Java Runtime Environment (JRE), a compiler, |and other development tools. 3.\What is the JRE? © The JRE (Java Runtime Environment) is the runtime portion of Java software, which is all you need to run Java japplications but not to develop them 4. What is the JVM? Othe JVM (Java Virtual Machine) is a platform-independent \execution environment that converts Java bytecode into machine language and executes it.5. What is bytecode? © Bytecode is the intermediate code generated after the Java compiler compiles the source code. It is platform- independent and can be executed by the JVM. 6. What is the difference between JDK, JRE, and JVM? ° + JDK: For development (contains JRE + tools for development). + JRE: For running Java applications (contains JVM + libraries). + JVM: For executing bytecode (runs Java programs). 7.1s Java platform-independent? Why? © Yes, Java is platform-independent because of its bytecode that can run on any system that has a JVM, regardless of the underlying architecture. 8. What is the main feature of the Java language? © The primary feature of Java is platform independence, achieved through the use of the JVM. 9. What is object-oriented programming (oop)?© 00? is a programming paradigm that relies on the concept of classes and objects. Key principles of OOP include encapsulation, inheritance, polymorphism, and abstraction. 10. What is a class in Java? © A class in Java is a blueprint from which objects are created. It can contain fields (attributes) and methods (functions) to define the behavior and state of objects. ll. What is an object in Java? © An object is an instance of a class. It is a real-world entity that holds state and behavior defined by its class ___12.|What is encapsulation? eo Encapsulation is the wrapping of data (tields) and code (methods) into a single unit, known as a class, and restricting direct access to some components. 13.|What is inheritance? © Inheritance is a mechanism where one class acquires the properties (fields and methods) of another class. It helps in code reusability. 14. What is polymorphism?© Polymorphism is the ability of a method to perform different functions based on the object that it is acting upon. It allows one interface to be used for a general class of actions. 15. What is abstraction? © Abstraction is the concept of hiding the internal implementation of a feature and only exposing the functionality to the user. 16. What is the difference between an interface and an abstract class? © - Interface: Can only have abstract methods and final fields (Java 8+ allows default and static methods). + Abstract class: Can have both abstract and concrete methods and can hold state. 17. What is a constructor in Java? © Aconstructor is a special method used to initialize objects. It is invoked when an object of a class is created. 18.|What is the default constructor? © A default constructor is a constructor provided by Java if no other constructors are defined in the class. It has no parameters.19..What is method overloading? © Method overloading is when a class has more than one method with the same name but different parameter lists (either in number or type). 20. What is method overriding? © Method overriding occurs when a subclass provides a specific implementation of a method that is already defined in its superclass. 21.\What is the 'super' keyword in Java? © The super keyword refers to the immediate parent class object. It is used to access parent class methods or constructors. 22. What is a package in Java? A package is a namespace that organizes classes and interfaces. It helps to avoid name conflicts and to control _ access. 23.|What is the use of the ‘final’ keyword? eo The final keyword can be used with classes, methods, and variables to indicate that they cannot be modified or extended.24. What is the static keyword? © The static keyword in Java is used for memory management. It can be applied to variables, methods, blocks, and nested classes. Static members belong to the class rather than instances. 25. What is the difference between static and instance variables? @ - Static variables are shared among all instances of a class. + Instance variables are unique to each instance of a class. 26. What is the 'this' keyword in Java? °° ‘The This keyword is used to refer to the current instance of the class. 27. What is exception handling? © Exception handling in Java is a mechanism to handle runtime errors, allowing normal flow of the application even after an error occurs. 28. What is the difference between checked and unchecked exceptions? © ° Checked exceptions are checked at compile-time. + Unchecked exceptions are checked at runtime (subclasses of RuntimeException).29. What is the try-catch block? © The try block contains code that might throw an exception, while the catch block handles the exception if it occurs. 30. What is the finally block in Java? © The finally block contains code that is always executed, regardless of whether an exception is thrown or caught. 31. What is the throw keyword in Java? © The throw keyword is used to explicitly throw an exception. 32. What is the throws keyword? © The throws keyword is used in method signatures to declare that a method may throw exceptions. 33. What are collections in Java? © The Java Collections Framework provides a set of interfaces and classes to store and manipulate data in groups. 34.\What is the difference between an Array and an ArrayList? © : Arrays are of fixed size, while ArrayLists are resizable. + Arrays can hold primitive types, whereas ArrayLists hold objects.
You might also like
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
From Everand
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
Mark Manson
4/5 (6125)
Principles: Life and Work
From Everand
Principles: Life and Work
Ray Dalio
4/5 (627)
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
From Everand
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
Brené Brown
4/5 (1148)
Never Split the Difference: Negotiating As If Your Life Depended On It
From Everand
Never Split the Difference: Negotiating As If Your Life Depended On It
Chris Voss
4.5/5 (932)
The Glass Castle: A Memoir
From Everand
The Glass Castle: A Memoir
Jeannette Walls
4/5 (8214)
Grit: The Power of Passion and Perseverance
From Everand
Grit: The Power of Passion and Perseverance
Angela Duckworth
4/5 (631)
Sing, Unburied, Sing: A Novel
From Everand
Sing, Unburied, Sing: A Novel
Jesmyn Ward
4/5 (1253)
The Perks of Being a Wallflower
From Everand
The Perks of Being a Wallflower
Stephen Chbosky
4/5 (8365)
Shoe Dog: A Memoir by the Creator of Nike
From Everand
Shoe Dog: A Memoir by the Creator of Nike
Phil Knight
4.5/5 (860)
Her Body and Other Parties: Stories
From Everand
Her Body and Other Parties: Stories
Carmen Maria Machado
4/5 (877)
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
From Everand
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
Margot Lee Shetterly
4/5 (954)
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
From Everand
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
Ben Horowitz
4.5/5 (361)
Steve Jobs
From Everand
Steve Jobs
Walter Isaacson
4/5 (2922)
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
From Everand
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
Ashlee Vance
4.5/5 (484)
The Emperor of All Maladies: A Biography of Cancer
From Everand
The Emperor of All Maladies: A Biography of Cancer
Siddhartha Mukherjee
4.5/5 (277)
Brooklyn: A Novel
From Everand
Brooklyn: A Novel
Colm Toibin
3.5/5 (2061)
A Man Called Ove: A Novel
From Everand
A Man Called Ove: A Novel
Fredrik Backman
4.5/5 (4972)
Angela's Ashes: A Memoir
From Everand
Angela's Ashes: A Memoir
Frank McCourt
4.5/5 (444)
The Art of Racing in the Rain: A Novel
From Everand
The Art of Racing in the Rain: A Novel
Garth Stein
4/5 (4281)
The Yellow House: A Memoir (2019 National Book Award Winner)
From Everand
The Yellow House: A Memoir (2019 National Book Award Winner)
Sarah M. Broom
4/5 (100)
The Little Book of Hygge: Danish Secrets to Happy Living
From Everand
The Little Book of Hygge: Danish Secrets to Happy Living
Meik Wiking
3.5/5 (447)
The World Is Flat 3.0: A Brief History of the Twenty-first Century
From Everand
The World Is Flat 3.0: A Brief History of the Twenty-first Century
Thomas L. Friedman
3.5/5 (2283)
Bad Feminist: Essays
From Everand
Bad Feminist: Essays
Roxane Gay
4/5 (1068)
Yes Please
From Everand
Yes Please
Amy Poehler
4/5 (1987)
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
From Everand
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
Gilbert King
4.5/5 (278)
The Outsider: A Novel
From Everand
The Outsider: A Novel
Stephen King
4/5 (1993)
The Woman in Cabin 10
From Everand
The Woman in Cabin 10
Ruth Ware
3.5/5 (2619)
A Tree Grows in Brooklyn
From Everand
A Tree Grows in Brooklyn
Betty Smith
4.5/5 (1936)
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
From Everand
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
Viet Thanh Nguyen
4.5/5 (125)
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
From Everand
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
Dave Eggers
3.5/5 (692)
Team of Rivals: The Political Genius of Abraham Lincoln
From Everand
Team of Rivals: The Political Genius of Abraham Lincoln
Doris Kearns Goodwin
4.5/5 (1912)
Wolf Hall: A Novel
From Everand
Wolf Hall: A Novel
Hilary Mantel
4/5 (4074)
On Fire: The (Burning) Case for a Green New Deal
From Everand
On Fire: The (Burning) Case for a Green New Deal
Naomi Klein
4/5 (75)
Fear: Trump in the White House
From Everand
Fear: Trump in the White House
Bob Woodward
3.5/5 (830)
Rise of ISIS: A Threat We Can't Ignore
From Everand
Rise of ISIS: A Threat We Can't Ignore
Jay Sekulow
3.5/5 (143)
Manhattan Beach: A Novel
From Everand
Manhattan Beach: A Novel
Jennifer Egan
3.5/5 (901)
John Adams
From Everand
John Adams
David McCullough
4.5/5 (2530)
The Light Between Oceans: A Novel
From Everand
The Light Between Oceans: A Novel
M L Stedman
4.5/5 (790)
The Unwinding: An Inner History of the New America
From Everand
The Unwinding: An Inner History of the New America
George Packer
4/5 (45)
Little Women
From Everand
Little Women
Louisa May Alcott
4/5 (105)
The Constant Gardener: A Novel
From Everand
The Constant Gardener: A Novel
John le Carré
3.5/5 (109)
Related titles
Click to expand Related Titles
Carousel Previous
Carousel Next
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
From Everand
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
Principles: Life and Work
From Everand
Principles: Life and Work
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
From Everand
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
Never Split the Difference: Negotiating As If Your Life Depended On It
From Everand
Never Split the Difference: Negotiating As If Your Life Depended On It
The Glass Castle: A Memoir
From Everand
The Glass Castle: A Memoir
Grit: The Power of Passion and Perseverance
From Everand
Grit: The Power of Passion and Perseverance
Sing, Unburied, Sing: A Novel
From Everand
Sing, Unburied, Sing: A Novel
The Perks of Being a Wallflower
From Everand
The Perks of Being a Wallflower
Shoe Dog: A Memoir by the Creator of Nike
From Everand
Shoe Dog: A Memoir by the Creator of Nike
Her Body and Other Parties: Stories
From Everand
Her Body and Other Parties: Stories
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
From Everand
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
From Everand
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
Steve Jobs
From Everand
Steve Jobs
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
From Everand
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
The Emperor of All Maladies: A Biography of Cancer
From Everand
The Emperor of All Maladies: A Biography of Cancer
Brooklyn: A Novel
From Everand
Brooklyn: A Novel
A Man Called Ove: A Novel
From Everand
A Man Called Ove: A Novel
Angela's Ashes: A Memoir
From Everand
Angela's Ashes: A Memoir
The Art of Racing in the Rain: A Novel
From Everand
The Art of Racing in the Rain: A Novel
The Yellow House: A Memoir (2019 National Book Award Winner)
From Everand
The Yellow House: A Memoir (2019 National Book Award Winner)
The Little Book of Hygge: Danish Secrets to Happy Living
From Everand
The Little Book of Hygge: Danish Secrets to Happy Living
The World Is Flat 3.0: A Brief History of the Twenty-first Century
From Everand
The World Is Flat 3.0: A Brief History of the Twenty-first Century
Bad Feminist: Essays
From Everand
Bad Feminist: Essays
Yes Please
From Everand
Yes Please
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
From Everand
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
The Outsider: A Novel
From Everand
The Outsider: A Novel
The Woman in Cabin 10
From Everand
The Woman in Cabin 10
A Tree Grows in Brooklyn
From Everand
A Tree Grows in Brooklyn
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
From Everand
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
From Everand
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
Team of Rivals: The Political Genius of Abraham Lincoln
From Everand
Team of Rivals: The Political Genius of Abraham Lincoln
Wolf Hall: A Novel
From Everand
Wolf Hall: A Novel
On Fire: The (Burning) Case for a Green New Deal
From Everand
On Fire: The (Burning) Case for a Green New Deal
Fear: Trump in the White House
From Everand
Fear: Trump in the White House
Rise of ISIS: A Threat We Can't Ignore
From Everand
Rise of ISIS: A Threat We Can't Ignore
Manhattan Beach: A Novel
From Everand
Manhattan Beach: A Novel
John Adams
From Everand
John Adams
The Light Between Oceans: A Novel
From Everand
The Light Between Oceans: A Novel
The Unwinding: An Inner History of the New America
From Everand
The Unwinding: An Inner History of the New America
Little Women
From Everand
Little Women
The Constant Gardener: A Novel
From Everand
The Constant Gardener: A Novel