Overview of Java for Selenium WebDriver
Data Types in Java:
Java Modifiers for Classes, Variables, and Methods:
- Access Modifiers : (Default, Public, Private and Protected).
- Non Access Modifiers : (Static, Final, Abstract, Synchronized etc…).
Type of Variables in Java:
- Local Variables.
- Instance variables.
- Class / Static Variables.
Operators in Java:
- Arithmetic Operators.
- Relational Operators.
- Bitwise Operators.
- Logical Operators.
- Assignment Operators
- If Statement.
- Switch Statement.
Usage of Conditional Statements:
- The statement is correct when executing a block of statements.
- When the condition is correct, then execute a block of statements, otherwise execute one more block of statements.
- Choose from several alternative options, for e.g: Else IF.
- Execution of a block of statements when more than one condition is true e.g: nested If.
- Choose from several alternative options e.g: Switch statement.
- For loop.
- While loop.
- Do While loop.
Arrays in Java:
- Generally, the array is a collection of elements of the same type.
- In Java, Array is an object that contains elements of the same data type.
- The Java array index is based, index starts with zero.
- The length of the array is set when the array is created and the length of the array is fixed.
- Each item in an array is called element.
Exception handling In Java:
- An exception is a program that occurs during the execution of a program which disturbs the normal flow of instructions.
- Exception in Java is a powerful mechanism for handling run-time errors in order to maintain the normal flow of the program.
Java Object Oriented programming System (OOPS) concepts: