Data types - Basic Java Tutorials For Selenium WebDriver

I accept received many requests from my weblog readers for posting approximately basic coffee tutorials which are actually required inward selenium webdriver software testing process. So at in i trial I accept planned to post service approximately basic coffee tutorial posts which are actually required inward selenium webdriver learning as well as implementation inward your software testing process. These tutorials volition attention you lot for selenium webdriver interview preparation too. Let nosotros showtime from dissimilar data types In java which nosotros tin locomote inward our selenium webdriver software attempt out instance preparation.

In coffee or whatsoever other programming languages, information types represents that which type of values tin hold upwards stored as well as what volition hold upwards the size of that value or how much retentiveness volition hold upwards allocated. There are nearest 8 dissimilar information types inward coffee like byte, short, int, long, float, double, char, Boolean. byte as well as brusk datatypes are non much to a greater extent than useful inward selenium webdriver as well as thus I am skipping them hither to decrease your confusions.

int datatype
int information type is useful to shop 32 fleck integer (Example : 4523) values only. We tin non shop decimal (Example 452.23) values inward int information type.
Example : 
int i = 4523;

long datatype
long datatype is useful to shop 64 fleck integer(Example : 652345) values. You tin locomote it when your value is to a greater extent than larger as well as tin non jibe it inward int. Same equally int datatype, nosotros tin non shop decimal (Example 452.23) values inward long datatype
Example : 
long 50 = 652345;

double datatype

double datatype is useful to shop 64 fleck decimal(Example : 56.2354) values. We tin shop integer (Example 12456) values also inward double datatype.
Example : 
double d1 = 56.2354;   double d2 = 12456;

char datatype

char datatype is useful to shop unmarried character(Example : 'd'). It tin non shop to a greater extent than than i (Example 'dd') graphic symbol inward it.
Example : 
char c = 'd';


boolean datatype

boolean datatype is useful to shop exclusively boolean(Example : true) values.
Example : 
boolean b = true;

String Class
String is non a information type but it is a cast which is useful to shop string inward variable.
Example :
String str = "Hello World";


Created bellow given instance for all these datatypes. Run it inward your eclipse as well as verify results.
public cast datatypes {   world static void main(String[] args) {   int i = 4523;   //Can shop 32 fleck integer values only.   long 50 = 652345;  //Can shop 64 fleck integer values only.   double d1 = 56.2354;         //Can shop 64 fleck decimal values.   double d2 = 12456;  //We tin locomote it for integer values too.   char c = 'd';   //Can shop unmarried graphic symbol only.   boolean t = true;  //Can shop exclusively boolean values similar truthful or false.   String str = "Hello World";  //Can shop whatsoever 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);  } }

Bellow given effect volition display inward your console at the halt of execution.
Integer Var Is --> 4523 Long Var Is --> 652345 double Var d1 Is --> 56.2354 double Var d2 Is --> 12456.0 char Var c Is --> d boolean Var b Is --> truthful String Var str Is --> Hello World
More interesting articles here :Generation Enggelmundus Internet Marketing Tool here :Zeageat IM 

http://www.software-testing-tutorials-automation.com/
Post a Comment (0)
Previous Post Next Post