2. Java Basics for Selenium - What is class and object in Java

preview_player
Показать описание
What is class and object?

Class: A program in java is written with class declaration. This is a basic plan using which we can create objects. All the program is enclosed in a class definition.
The body of the program is contained in a main method. In java the execution starts from main method.

Object: An object is an instance of a class.

To create an object, we use the keyword “new”

General Examples:
If you want to construct a house, you will have a plan. The plan is nothing but a class. The constructed house is nothing but an object.
You can create any number of houses using the same plan. That means you can create any number of objects using a class.
Each and every house might differ in the number of rooms it has. That means objects will differ in their properties.
welcome to shbcf.ru