Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
8 views

UDEMY Programming Language OC Java

The document outlines a course on Selenium Java Test Framework and best practices, taught by Omprakash Chavan, with a focus on Java programming. It includes links to various resources, test automation frameworks, and essential Java concepts such as OOP principles, control structures, and exception handling. Additionally, it provides information about the document's author, Rajat Verma, and his online profiles.

Uploaded by

abhimanyu thakur
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

UDEMY Programming Language OC Java

The document outlines a course on Selenium Java Test Framework and best practices, taught by Omprakash Chavan, with a focus on Java programming. It includes links to various resources, test automation frameworks, and essential Java concepts such as OOP principles, control structures, and exception handling. Additionally, it provides information about the document's author, Rajat Verma, and his online profiles.

Uploaded by

abhimanyu thakur
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

====================================================

Tutor: Omprakash Chavan


Reference: UDEMY
Course: Selenium Java Test Framework & Best Practices -
Masterclass
Content: Programming language - JAVA
====================================================
1. Document prepared by
a. Rajat Verma
i. Github Profile: https://github.com/rajatt95

ii. Github Page: https://rajatt95.github.io

iii. LinkedIn: https://www.linkedin.com/in/rajatt95

iv. Topmate: https://topmate.io/rajatt95

v. Telegram: https://t.me/rajatt95

vi. Instagram: https://www.instagram.com/rajattvermaa95

vii. Youtube: https://www.youtube.com/@rajatt95


—------------------
2. Test Automation Frameworks available on Github
a. WEB

i. Selenium WebDriver + Java

ii. Cypress + (Javascript and Typescript)

iii. Playwright + (Javascript and Typescript)


b. MOBILE

i. Appium + Java
c. API

i. Rest Assured + Java

ii. Requests + Python


-------------------------------------------------------------------------------------------------------------------------------

1
—------------------
3. Documents:

a. Github repository: https://github.com/rajatt95/Documents

b. Google Drive:
https://drive.google.com/drive/folders/1tne9pZjgWvfrS0l9tVHs6k1jnQHpTLoA

4. Last worked on this Document:


a. Nov 26, 2022

5. Learnings from Tutor (Code Repository):


a. This course
i. https://github.com/stars/rajatt95/lists/udemy-oc-selenium
b. Other course(s):
i. https://github.com/stars/rajatt95/lists/udemy-omprakash-chavan

—------------------
Softwares:
1. Programming language - Java
2. IDE - IntelliJ/Eclipse
—------------------

1. Learnings from Course (UDEMY - OC)


a. Links:
i. Java
ii. IDE-IntelliJ
1. https://www.jetbrains.com/idea/download/#section=mac

—------------------

-------------------------------------------------------------------------------------------------------------------------------

2
—------------------
JAVA - START
—------------------
b. Java:
i. Basics:
1. Package
2. Class
a. Components:
i. Fields/Parameters/Variables
ii. Constructors
iii. Methods/Behavior

3. Object:
4. Method
5. Variables
a. Initialize Variable using Method
b. Initialize Variable using Default Constructor
c. Initialize Variable using Parameterized Constructor
6. Constructor
a. With Arguments
b. Without Arguments
7. Data Types:
a. Primitive
i. int, float, double, boolean
b. Reference
i. String
8. Strings

a. Coversion:
i. String to int -> Integer.parseInt(str)

-------------------------------------------------------------------------------------------------------------------------------

3
ii. int to String -> String.valueOf(number1)

9. Constants
a. Access constants from other files
10. Enums
a. The special class that represents a group of constants
b. Access Enum constants from other files
11. Keyword:
a. static:
i. Shared between all objects
b. final:
i. Assign value only once
c. return
d. this
i. Returns class object
e. super
i. It is used to differentiate members of Superclass from
members of Subclass if they have the same names
ii. It is used to invoke the constructor of Superclass from
Subclass

ii. Control Structures:


1. If …. Else
a. Multiple Conditions
i. & -> Both the conditions have to be true
ii. | -> One condition has to be true
2. For
3. For Each
4. While
5. Switch-Case
a. With String
b. With Enum

iii. OOP - Inheritance:


1. Inheritance
a. It is the mechanism by which one class acquires properties
(Fields and Methods) of another class
b. Why?
i. Re-Usability
c. How?
i. Using extends keyword
d. Sub/Derived/Child class inherits the properties of
Super/Base/Parent class
-------------------------------------------------------------------------------------------------------------------------------

4
—------------------
e. Types of Inheritance:
i. Single inheritance
ii. Multilevel inheritance
iii. Hierarchical inheritance
iv. Multiple inheritance (using interface)

iv. Access Modifiers:


1. public, protected, private, default

2.
3. Applicability:
a. Class: public, default
b. Attributes and methods: public, private, protected, default

v. OOP - Encapsulation
1. Encapsulation:
a. Wrapping up of data under a single unit! The data is
protected!
b. Use getter and setter methods to access private
attributes

vi. OOP - Polymorphism


1. Polymorphism:
a. The ability of an object to take many forms!
b. How?
i. By Overriding or Overloading methods.
c. Polymorphism Types
i. Runtime polymorphism
1. E.g. Method Overriding
ii. Compile-time polymorphism:
1. E.g. Method Overloading
d. Notes:
i. final methods cannot be overridden
ii. Static methods cannot be overridden (method hiding)

vii. OOP - Abstraction using Abstract class


1. Abstraction:
a. Hide details and show only essential information!
b. Partial abstraction (0 to 100%).
-------------------------------------------------------------------------------------------------------------------------------

5
—------------------
viii. OOP - Abstraction using Interface
1. Abstraction:
a. Hide details and show only essential information!
b. 100% abstraction.

c. Interface
i. Java8: Can have a default method
ii. Java8: Can have a static method

d. Advantages:
i. Helps achieve multiple inheritance

ix. Exception Handling


1. Exception types
a. Compile-time exception (checked exceptions)
i. FileNotFoundException
b. Runtime exception (unchecked exception)
i. ArrayIndexOutOfBoundsException

x. File Operations
1. Creation of a new file
2. Opening an existing file
3. Reading from file
4. Writing to a file
5. Closing a file
6. Deleting a file

7. Java classes
i. FileReader, BufferedReader, Files, Scanner,
FileInputStream, FileWriter, BufferedWriter,
ii. FileOutputStream, etc.

—------------------
JAVA - END
—------------------

-------------------------------------------------------------------------------------------------------------------------------

6
-----------------------------------------
========4_JAVA Essentials [Optional]==========
-----------------------------------------

—--------19. Section Intro —--------------

1. Basics:
a. Class
b. Method
c. Variable
d. Constructor
e. Strings
f. Constants
g. Enums

2. Control Structures:
a. Switch-Case
b. For
c. If …. else
d. For Each
3. OOP concepts:
a. Inheritance
b. Encapsulation
c. Abstraction
d. Polymorphism

4. Access Modifiers:
a. public
b. protected
c. private

5. Exception Handling

6. File Operations

—------------------

-------------------------------------------------------------------------------------------------------------------------------

7
—--------20. Java Basics - Part 1 —--------------

1. Package
a. Naming:
i. lower case
ii. Example:
1. com.learning.java
2. Class
a. Naming:
i. Camel Case
ii. Example:
1. MyFirstJavaClass
3. Object:
a. Naming:
i. lower case
4. Method
5. Data Types:
a. Primitive
i. int, float, double, boolean
b. Reference
i. String
6. Variables
a. Naming:
i. lower case
7. Constructor
a. With Arguments
b. Without Arguments
8. Keyword:
a. static:
i. Shared between all objects
b. final:
i. Assign value only once
c. return
d. this
i. Returns class object

9. Constants
10. Enums
a. The special class that represents a group of constants
11. Strings
12. Data Type conversions

-------------------------------------------------------------------------------------------------------------------------------

8
—--------21. Java Basics - Part 2 —--------------

1.

—------------------

1. Class has:
a. Fields/Parameters/Variables
b. Constructors
c. Methods/Behavior

2. Data Types:
a. Primitive:
i. int
ii. float
iii. double
iv. boolean
b. Reference
i. Strings

—------------------

-------------------------------------------------------------------------------------------------------------------------------

9
—------------------

1.

2.

—------------------

-------------------------------------------------------------------------------------------------------------------------------

10
—------------------

3.

4.

—------------------

-------------------------------------------------------------------------------------------------------------------------------

11
—------------------

5.

—--------22. Java Basics - Part 3 —--------------

1.

2.

—------------------

-------------------------------------------------------------------------------------------------------------------------------

12
—------------------

1.

2.

—------------------

-------------------------------------------------------------------------------------------------------------------------------

13
—--------23. Java Basics - Part 4 —--------------

1.

2.

3.

—------------------

-------------------------------------------------------------------------------------------------------------------------------

14
—--------24. Control Structures —--------------

1. Control Structures:
a. If …. Else

i.

ii.

—------------------

-------------------------------------------------------------------------------------------------------------------------------

15
—------------------

iii.

b. For

i.

—------------------

-------------------------------------------------------------------------------------------------------------------------------

16
—------------------
c. For Each

i.
d. While

i.

e. Switch-Case

i.

-------------------------------------------------------------------------------------------------------------------------------

17
—------------------

ii.

—--------25. OOP - Inheritance and super Keyword —--------------

1. Inheritance:
a. It is the mechanism by which one class acquires properties (Fields and Methods) of
another class
b. Why?
i. Re-Usability
c. How?
i. Using extends keyword
d. Classes:
i. SubClass | DerivedClass | ChildClass
ii. SuperClass | BaseClass | ParentClass
e. Points:
i. A subclass can have its own methods and fields in addition to Superclass's
methods and fields
ii. A subclass can have only one Superclass. In other words, multiple
inheritance is not supported by using classes
iii. A subclass cannot inherit Superclass's constructor, but it can invoke the
constructor
iv. Sub/Derived/Child class inherits the properties of Super/Base/Parent
class

—------------------

-------------------------------------------------------------------------------------------------------------------------------

18
—------------------
2. Types of Inheritance:
a. Single inheritance
b. Multilevel inheritance
c. Hierarchical inheritance
d. Multiple inheritance (using interface)

3. super keyword:
a. It is used to differentiate members of Superclass from members of Subclass if they
have the same names
b. It is used to invoke the constructor of Superclass from Subclass

—------------------

1.

—------------------

-------------------------------------------------------------------------------------------------------------------------------

19
—------------------

2.

3.

—------------------

-------------------------------------------------------------------------------------------------------------------------------

20
—--------26. Access Modifiers —--------------

1. Access Modifiers:
a. public, protected, private, default

b.

2. Definition
a. public: Everywhere
b. protected: by class in the same package or by subclass if the outside package
c. private: Within the class
d. default: by class in the same package

3. Applicability:
a. Class: public, default
b. Attributes and methods: public, private, protected, default

4. NOTES:
a. Use private for attributes unless there is a good reason not to do so
b. Use public for constants
c. Use protected if you want class members to be accessed by subclasses or by classes
in the same package
d. Use private if you think the method will be accessed only within the class

—--------27. OOP - Encapsulation —--------------

1. Encapsulation:
a. Wrapping up of data under a single unit! The data is protected!
b. How?
i. By making class attributes (or variables) private
ii. By making methods private
c. Use getter and setter methods to access private attributes
d. Advantages
i. Data hiding
ii. Flexibility to use variables as read-only or write-only
iii. Reusability

—------------------
-------------------------------------------------------------------------------------------------------------------------------

21
—------------------

1.

2.

—------------------

-------------------------------------------------------------------------------------------------------------------------------

22
—--------28. OOP - Polymorphism —--------------

1. Polymorphism:
a. The ability of an object to take many forms!
b. How?
i. By Overriding or Overloading methods.

c. Method Overriding
i. Allows a subclass to provide a specific implementation of a method that is
already provided by its superclass
ii. The method in the subclass should have the same name, same signature, and
same return type(or sub-type) as the method in its superclass

d. Method Overloading
i. Allows different methods to have the same name, but different signatures
where the signature can differ by the number of input parameters or type of
input parameters or both

e. Polymorphism Types
i. Runtime polymorphism or Dynamic method dispatch:
1. Call resolved at runtime based on the type of the object being
referred to at the time the call occurs
2. E.g. Method Overriding
ii. Compile-time polymorphism: Call resolved at compile time
1. E.g. Method Overloading

f. Notes:
i. final methods cannot be overridden
ii. Static methods cannot be overridden (method hiding)

—------------------

-------------------------------------------------------------------------------------------------------------------------------

23
—------------------
1. Method Overriding:

a.

b.

—------------------

-------------------------------------------------------------------------------------------------------------------------------

24
—------------------

c.

d.

—------------------

-------------------------------------------------------------------------------------------------------------------------------

25
—------------------
2. Method Overloading:

a.

b.

—------------------

-------------------------------------------------------------------------------------------------------------------------------

26
—--------29. OOP - Abstraction using Abstract Class —--------------

1. Abstraction:
a. Hide details and show only essential information!
b. Partial abstraction (0 to 100%).

c. Abstract class
i. Provides partial abstraction
ii. An abstract method is declared without an implementation
iii. An abstract class cannot be directly instantiated
iv. A subclass can access the Abstract class using extends keyword
v. A subclass must implement all abstract methods i.e. Overriding is
compulsory
vi. An abstract class can have default and parameterized constructor
1. But, we can not create the object of an Abstract class

d. Advantages:
i. Reduces complexity by hiding implementation
ii. Better viewing
iii. Avoids code duplication and promotes reusability
iv. Increases security by providing only important details to the user

e. Example
i. Shapes: Abstract
ii. Triangle: SubClass1
iii. Square: SubClass2

—------------------

-------------------------------------------------------------------------------------------------------------------------------

27
—------------------

1.

2.

-------------------------------------------------------------------------------------------------------------------------------

28
—------------------

3.

4.

—------------------

-------------------------------------------------------------------------------------------------------------------------------

29
—------------------

5.

—--------30. OOP - Abstraction using Interface —--------------

1. Abstraction:
a. Hide details and show only essential information!
b. 100% abstraction.

c. Interface
i. Provides complete abstraction (blueprint! - what to do and not how to do!)
ii. Methods are by default abstract and public
iii. Attributes are by default public, static and final. In other words, attributes
are constants
iv. Cannot contain a constructor
v. Must be implemented by other class using the implements keyword
vi. A subclass must implement all abstract methods
vii. A subclass can implement multiple interfaces
viii. Java8: Can have a default method
ix. Java8: Can have a static method

d. Advantages:
i. Reduces complexity by hiding implementation
ii. Increases security by providing only important details to the user
iii. Helps achieve multiple inheritance

e. Example
i. Shapes: Abstract
ii. Triangle: SubClass1
iii. Square: SubClass2

-------------------------------------------------------------------------------------------------------------------------------

30
—------------------

1.

-------------------------------------------------------------------------------------------------------------------------------

31
—------------------

2.

3.

-------------------------------------------------------------------------------------------------------------------------------

32
—------------------

4.

—--------31. Exception Handling —--------------

1. Exception types
a. Compile-time exception (checked exceptions)
i. FileNotFoundException
b. Runtime exception (unchecked exception)
i. ArrayIndexOutOfBoundsException

2. Ways to handle exceptions


a. Handling exceptions using try-catch-finally
b. throws keyword: postpone exception
c. try with resources
d. user-defined exception
e. throw new Exception

—------------------

-------------------------------------------------------------------------------------------------------------------------------

33
—------------------

1.

2.

—------------------

-------------------------------------------------------------------------------------------------------------------------------

34
—------------------

3.

4.

-------------------------------------------------------------------------------------------------------------------------------

35
—------------------

5.

6.

-------------------------------------------------------------------------------------------------------------------------------

36
—------------------

7.

8.

—------------------

-------------------------------------------------------------------------------------------------------------------------------

37
—--------32. File Operations —--------------

1. File operations
a. Creation of a new file
b. Opening an existing file
c. Reading from file
d. Writing to a file
e. Closing a file
f. Deleting a file

g. Java classes
i. FileReader, BufferedReader, Files, Scanner, FileInputStream, FileWriter,
BufferedWriter,
ii. FileOutputStream, etc.

h. Operations
i. Create file
ii. Read file properties
iii. Read and Write file using FileReader and FileWriter
iv. Read and Write file using FileInputStream and FileOutputStream
v. Use relative file path (File separator)
—------------------

1.

-------------------------------------------------------------------------------------------------------------------------------

38
—------------------

2.

3.
-------------------------------------------------------------------------------------------------------------------------------

39
—------------------

4.

5.

-------------------------------------------------------------------------------------------------------------------------------

40
—------------------

6.

7.
-------------------------------------------------------------------------------------------------------------------------------

41
—------------------

8.

—-------- 22. Code Download—--------------

1. https://github.com/rajatt95/Java_OC

=======================================================================

====================================================

-------------------------------------------------------------------------------------------------------------------------------

42
=======================================================================

1. Documents

a. Github repository: https://github.com/rajatt95/Documents

b. Google Drive:
https://drive.google.com/drive/folders/1tne9pZjgWvfrS0l9tVHs6k1jnQHpTLoA

2. Learnings from Tutor (Code Repository)


a. This course:
i. https://github.com/stars/rajatt95/lists/udemy-oc-selenium
b. Other course(s):
i. https://github.com/stars/rajatt95/lists/udemy-omprakash-chavan

3. To connect

a.
=======================================================================

=======================================================================

-------------------------------------------------------------------------------------------------------------------------------

43

You might also like