
Variable declarationĪ variable declaration can be done using the syntax – Datatype VariableName For example, a variable of integer data type occupies four bytes of memory whereas a character occupies only two bytes of memory. Each variable has a different memory allocation based on the data type. Technically, a variable can be defined as a memory location or space reserved to store information of different data types such as integer, character, float, boolean and double. A programmer can use variables rather than giving the data directly and during the compile time, the variables are replaced with the data entered by the programmer. Data is a fixed or a constant value that does not change during the execution of a program. A simple program can be written using data and instructions. What is a variable?Ī variable is something that varies or changes. But in Java tutorial for Selenium, we use only basic data types such as integer, boolean, character and double. There are data types such as boolean, integer, character, double, floating-point, alphanumeric, short, and long. What is a data type?Ī data type is an indicator for the type of data that a variable holds. Knowledge on data types and variables helps to easily understand programming in Java for Selenium. A class can have one variable or a group of variables. The body of the class is delimited by curly brackets (). Creation of ClassĪ class can be created using the keyword class followed by a name. The major difference between an object and a class is that an object is created during the run time whereas a class is created during the program. Objects created from a single class always share a similar state and behavior. What is a class?Ī class can be defined as guide to create objects. From the above example, we can define an object (dog) as a collection of variables (breed, color, age and size) and methods (eat, run and sleep). It implements its state in the form of variables and behavior in the form of methods. Similarly in an object-oriented language like Java, object is called as a class instance which performs a group of activities. For example, dog is an object which has state (breed, color, age and size) and behavior (eat, run, sleep etc.). In real world, an object is defined as a thing which we can see, touch and feel. It becomes easy to understand these concepts once they are visualized and related to real life.

#SELENIUM JAVA TUTORIAL SOFTWARE#
Skills That Will Make You a Champ Software Tester with Latest TrendsĬlasses and Objects are the basic and important concepts in Java programming.Using Selenium to Interact With Elements on a Web Page.

#SELENIUM JAVA TUTORIAL HOW TO#

How to Install Debugbar Tool - SELENIUM.How to Locate & Find Elements - SELENIUM.

