Best Interview Question & Answer asked in Interviews !

Wondering what type of questions to ask in Automation Testing ,Functional Testing, API Testing in Interview ? No need to worry now because here we have posted all interview questions asked in Automation Testing Interview, ,Functional Testing, API Testing in interviews.

1.Write a Program to Reverse a String ?

Visit Program Page to get this program.

2. What is mean by OPPS ?

OOPS is Object Oriented Programming Structure. OOPS is a method of implementation in which programs are organized as collection of objects, class and methods.

3. What is mean Class & Method ,Object ?

Class: Class is a collection of objects and methods • Class contains attributes(variables and methods) that are common to all the objects created in a class.
Method : Method defines the set of action to be performed.
Object : Object is the run time memory allocation. • Using object we call any methods.

4. What is mean by Encapsulation ?

It is the structure of creating folders.It wraps the data and code acting on data together in to a single unit.
Ex: encapsulation is POJO class. It is otherwise called Data hiding.

5. What is the main use of Scanner class?

To get the inputs from the user at the run time.

6. What are the methods available in Scanner Class?

  • nextByte();
  • nextShort();
  • nextInt();
  • nextLong();
  • nextFloat();
  • nextDouble();
  • next().charAt(0);
  • next();
  • nextLine();
  • nextBoolean();

7. What is Method overloading and overriding?

Method overriding is used to provide the specific implementation of the method that is already
provided by its super class. Method overloading is performed within class. Method overriding occurs in
two classes that have IS-A (inheritance) relationship. In case of method overloading, parameter must be
different.

8. What is mean by polymorphism?

Poly-many-Morphism-forms. Taking more than one forms is called polymorphism or one task implemented in many ways.

9. What is mean by inheritance?

Accessing one class Properties in another class without multiple object creation. It avoids time and memory wastage. • It ensures code reusability \

10.What are the ways to access the methods /data from another class?

We can access the another class methods either by creating object or using extends keyword.

11. What is mean by access specifier?

It defines the scope or level of access for variables,methods and classes

12.What are the difference between public and protected?

Public: It is global level access( same package + different package).
Protected: can access Inside package ( object creation + extends )

13.What is mean by Abstraction?

Hiding the implementation part or business logic is called abstraction.

14.What are the types of Abstraction?

  • Partially abstraction(using abstract class).
  • Fully abstraction(using interface).

15.Can we create Object for Abstract class?

No, we cant create object for abstract class.

16.What is mean by Interface?

It will support only abstract method(without business logic), won’t support non abstract method(method with business logic)
In interface “public abstract” is default.
using “implements” keyword we can implement the interface in a class where we can write the business logic for all unimplemented methods.

17.What are the difference between Abstract and Interface?

Abstract class: Using Abstract class,we can acheive partial abstraction.
• It support both abstract method and non-abstract method.
• using “extends” keyword you can inherit an abstract class.
• For any abstract method we need to mention “public abstract”.

Interface: Using interface,we can acheive full abstraction.
• It supports only abstract method.
• It is using “implements” keyword.
• “public Abstract” is default, no need to mention it explicitly.

18.What is mean by String?

• Collection of characters or words enclosed within double quotes is called as String.
• String is a class in java
• String is index based
• Example : “greenstechnology”.