Datatypes – Fundamental Java Courses Regarding Selenium WebDriver
I’ve obtained numerous demands from my blog visitors regarding publishing several fundamental espresso lessons that are truly needed in selenium webdriver application screening procedure. Therefore today I’ve prepared to publish several fundamental espresso guide articles that are truly needed in selenium webdriver understanding and execution inside your application screening procedure.

These lessons can help you regarding selenium webdriver meeting planning also. Allow we begin with various datatypes In espresso which we are able to use within our selenium webdriver application test-case planning.

In espresso or every other encoding dialects, datatypes signifies what kind of ideals could be saved and what’ll function as the dimension of this worth or just how much storage is likely to be allotted. You will find nearest ten various datatypes in espresso like byte, brief, int, lengthy, drift, dual, char, Boolean. byte and brief datatypes aren’t a lot more helpful in selenium webdriver and so I am missing these below to diminish your confusions.
int datatype :
int info form is advantageous to shop 32-bit integer (Instance: 4523) ideals just. We cannot shop decimal (Instance 452.23) ideals in int info form.

Example : 

int i = 4523;
long datatype
long datatype is useful to store 64 bit integer(Example : 652345) values. You can use it when your value is more larger and can not hold it in int. Same as int datatype, we can not store decimal (Example 452.23) values in long datatype

Example : 

long l = 652345;
double datatype
double datatype is useful to store 64 bit decimal(Example : 56.2354) values. We can store integer (Example 12456) values too in double datatype.

Example : 

double d1 = 56.2354;  
double d2 = 12456;
char datatype
char datatype is useful to store single character(Example : ‘d’). It can not store more than one (Example ‘dd’) character in it.
Example : 
char c = 'd';

boolean datatype
boolean datatype is useful to store only boolean(Example : true) values.
Example : 

boolean b = true;

String Class
String is not a data type but it is a class which is useful to store string in variable.
Example :

String str = "Hello World";

VIEW DIFFERENT FUNCTIONS OF STRING CLASS

Created bellow given example for all these datatypes. Run it in your eclipse and verify results.

public class datatypes {

public static void main(String[] args)

{

int i = 4523; //Can store 32 bit integer values only.

long l = 652345; //Can store 64 bit integer values only.

double d1 = 56.2354; //Can store 64 bit decimal values.

double d2 = 12456; //We can use it for integer values too.

char c = ‘d’; //Can store single character only.

boolean t = true; //Can store only boolean values like true or false.

String str = “Hello World”; //Can store any string values.

System.out.println(“Integer Var Is –> “+i); System.out.println(“Long Var Is –> “+l); System.out.println(“double Var d1 Is –> “+d1); System.out.println(“double Var d2 Is –> “+d2); System.out.println(“char Var c Is –> “+c); System.out.println(“boolean Var b Is –> “+t); System.out.println(“boolean Var str Is –> “+str); }

}

Leave a Reply

Your email address will not be published. Required fields are marked *