0% found this document useful (0 votes)
11 views2 pages

Java Core Notes Interview Programs QA

The document is a guide containing core Java interview questions and answers specifically for Selenium automation. It covers key OOP concepts such as inheritance, polymorphism, abstraction, and encapsulation, as well as differences between interfaces and abstract classes. Additionally, it discusses method overloading and overriding, providing a comprehensive resource for interview preparation.

Uploaded by

Terala Manideep
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

Java Core Notes Interview Programs QA

The document is a guide containing core Java interview questions and answers specifically for Selenium automation. It covers key OOP concepts such as inheritance, polymorphism, abstraction, and encapsulation, as well as differences between interfaces and abstract classes. Additionally, it discusses method overloading and overriding, providing a comprehensive resource for interview preparation.

Uploaded by

Terala Manideep
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

All Core Java Interview Questions & Answers for Selenium Automation - Real-Time Guide

All Core Java Interview Questions & Answers for Selenium Automation - Real-Time Guide

1. OOPs Concepts

Q1: What is Inheritance in Java?

A: Inheritance is a mechanism where one class acquires the properties (fields) and behaviors (methods) of another

class. Useful for code reusability.

class Animal {

void eat() { System.out.println("eating..."); }

class Dog extends Animal {

void bark() { System.out.println("barking..."); }

Q2: What is Polymorphism?

A: The ability of an object to take many forms. It is of two types:

- Compile-time (Method Overloading)

- Runtime (Method Overriding)

Q3: What is Abstraction?

A: Hiding internal implementation and showing only the functionality. Achieved using abstract classes and interfaces.

Q4: What is Encapsulation?

A: Wrapping data and code into a single unit (class), usually by making fields private and providing public

getters/setters.

2. Interface vs Abstract Class

Q5: Difference between Interface and Abstract Class?

A:

Feature | Interface | Abstract Class

-------------------- | ------------------------------ | --------------

Multiple Inheritance | Yes | No

Page 1
All Core Java Interview Questions & Answers for Selenium Automation - Real-Time Guide

Constructors | No | Yes

Access Modifiers | Only public | Can use all

Implementation | Only abstract methods (Java 7) | Can have both

3. Method Overloading vs Overriding

Q6: What is Method Overloading?

A: Same method name with different parameters.

Q7: What is Method Overriding?

A: Redefining a method of the parent class in the child class.

... (continues for all 28 questions as shown above)

Page 2

You might also like