Java for Selenium Interview Questions
1) Why nosotros prefer Java for Selenium?
• Selenium written inwards Java, it doesn't hateful that Java entirely to a greater extent than compatible amongst selenium, nosotros tin utilisation other supported languages also.
• Good back upward for Selenium amongst Java, You tin acquire to a greater extent than aid documents as well as implementations from Internet.
• Majority of Selenium Testers(nearly 77%) using Java, thence cognition sharing is rattling easy.
• Java is platform independent language, nosotros tin utilisation it on whatsoever Operating environment.
2) How much Java is required for Selenium?
• For Test Automation using Selenium Core Java cognition is sufficient, Advanced Java non required.
• Java Basics as well as Object Oriented Concepts are enough.
• Java Basics are Data Types, Variables, Modifiers, Operators, Flow Control statements, Functions, Comments etc...
• Java OOPS concepts are Abstraction, Polymorphism, Inheritance, as well as Encapsulation.
3) What is Java?
• Java Programming Language was developed yesteryear Lord's Day Microsystems inwards 1995, Now it is subsidiary of Oracle corporation.
• Java is an Object Oriented programming Language, In Java, everything is an Object. Java tin endure easily extended since it is based on the Object model.
• Java is a Platform independent Language. It tin endure compiled as well as interpreted.
• Java is Simple, It is slowly to larn as well as implement.
• coffee is Securable, using Java nosotros tin prepare virus costless as well as tamper costless systems.

4) How to Set upward Java Environment for Windows Operating Environment?
• Download Java (JDK) software as well as Install.
• Set Path Environment Variable to access Java from whatsoever directory.
• Download as well as extract Eclipse IDE to write as well as execute Java Programs.
For to a greater extent than information visit:
5) What are the Advantages of Java or usage of Java?
• Java is used to Develop Desktop Applications (Ex: Acrobat Reader)
• Java is used to Develop Web Applications.
• Java is used to Develop Enterprise Applications (ex: banking, Insurance Applications).
• Java is used to Develop Mobile applications.
• Java is used to Develop Embedded systems.
• Java is used to Develop Smart cards.
• Java is used to Develop Games Software etc...
6) What are the Java linguistic communication Syntax Rules?
• Java is illustration sensitive language(deference is at that topographic point inwards betwixt upper as well as lower illustration letters)
• First alphabetic lineament of a Class Name should endure inwards upper case.
• Method names should outset amongst lower illustration letter
• Java Program file cite should precisely gibe amongst course of teaching name.
• populace static void principal (String args[])- Java plan execution starts from principal method, which is mandatory inwards every coffee program.
• Every contention should goal amongst semi colon symbol.
7) What is the primary purpose of Comments?
To brand the code readable.
8) What is Data Type?
Data type is a classification of the type of information that a variable or object tin concord inwards Computer programming.
9) What are the 8 primitive information types inwards Java?
• Integer Data types
i) byte (8 bits)
ii) brusk (16 bits)
iii) int (32 bits)
iv) long (64 bits)
• Rational Data types (Numbers amongst decimal places)
v) float (32 bits)
vi) double (64 bits)
• Characters
vii) char (16 bits)
• Conditional
viii) Boolean
9) What are Java Modifiers?
• Modifiers are keywords that nosotros add together to those definitions to alter their meanings.
• Java has 2 types of modifiers, One is Access Modifiers to a greater extent than or less other is Non-Access Modifiers.
• Access Modifiers are public, private, default as well as protected.
• Non-Access Modifiers are static, final, abstract etc...
10) What are the types of Variables inwards Java?
Java has iii types of variables:
i) Instance variables
(A variable that is declared within the course of teaching but exterior the method.)
ii) Local variables
(A variable that is declared within the Method.)
iii) Static / course of teaching variables
(A variable that is declared equally static, It cannot endure local.)
11) What are the categories of operators inwards Java?
Operators are used to perform mathematical, Comparison as well as Logical operations.
Important categories of Operators inwards Java:
i) Assignment Operators
ii) Arithmetic operators
iii) Relational operators
iv) Logical Operators
Etc...
12) What are the Conditional statements inwards Java?
Types of Conditional statements inwards Java:
i) if statement
ii) switch statement
13) What are the Loop statements inwards Java?
Whenever nosotros desire execute a block of statements multiple times thence nosotros utilisation Loop structures.
There are 4 types of Loop structures inwards Java.
i) for loop
ii) patch loop
iii) create patch loop
iv) Enhanced for loop
14) What is String?
• String is a sequence of characters written double quotes.
• String may bring Alfa bytes, numbers as well as exceptional characters.
15) Explain most Arrays inwards Java?
• Java Array is an Object that holds a fixed publish of values of a unmarried information type.
• The length of an Array is established when the Array is created.
• Array length is fixed, Java Array has Zero based index.
16) What are Java Methods?
• Method is a laid of statements to perform an Operation.
• Methods equally good known equally Procedures or Functions.
• In Structure programming nosotros utilisation Functions (Built inwards as well as User defined)
• In Object Oriented programming nosotros utilisation Methods (Built inwards as well as User defined)
17) What is Exception treatment inwards Java?
• An exceptions is an event, which occurs during execution of a program.
• Exception treatment is machinery to stimulate got exceptions.
18) What is Inheritance?
• It is a procedure of Inheriting (reusing) the course of teaching members (Variables as well as Methods) from ane course of teaching to to a greater extent than or less other course of teaching is called Inheritance.
• Non static (Object Level) course of teaching members entirely tin endure inherited.
• The course of teaching where the course of teaching members are getting inherited is called equally Super course of teaching / bring upward course of teaching / Base class.
• The course of teaching to which the course of teaching members are getting inherited is called Sub course of teaching / Child course of teaching / Derived class.
• The inheritance betwixt Super course of teaching as well as Sub course of teaching is achieved using "extends" keyword.
19) What is Polymorphism?
Polymorphism means, being of Object conduct inwards many forms.
There are 2 types of Polymorphism inwards Java:
i) Compile Time Polymorphism / Static binding / Method overloading
ii) Run Time Polymorphism / Dynamic binding / Method overriding
20) What is Abstraction?
It is a procedure of hiding implementation details as well as showing entirely functionality to the user.
21) What is Java Interface?
• Interface is a Java type Definition block which is 100% abstract.
• All the Interface methods are yesteryear default populace as well as abstract.
• Static as well as in conclusion modifiers are non allowed for interface methods.
• In Interfaces variables bring to initialize at the fourth dimension of declaration.
22) What is Encapsulation?
It is a procedure of wrapping code as well as information into a unmarried unit.
Encapsulation is the technique making the fields inwards a course of teaching someone as well as providing access via populace methods
• It provides us command over the data.
• By providing setter as well as getter methods, nosotros tin brand a course of teaching read entirely or write only.
• If nosotros don't define setter method thence read only.
----------------------------------------
Selenium Interview Questions-1
Selenium Interview Questions-2
Java for Selenium Interview Questions
Selenium WebDriver Questions
Selenium IDE Questions
TestNG Interview Questions