0% found this document useful (0 votes)
16 views3 pages

Coding Notes For Automation

Uploaded by

RaMa CHaitanya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views3 pages

Coding Notes For Automation

Uploaded by

RaMa CHaitanya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

Integers

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

byte age;
age = 25;

short marks;
marks = 900;

int salary = 40000;


long turnover = 100000000;

System.out.println(age);
System.out.println(marks);
System.out.println(salary);
System.out.println("Turnover "+turnover);
-----------------------------------------------------------------------------------
----
Real Numbers
-----------------------------------------------------------------------------------
---

float x = 1.00000142f;
double y = 10.25d;
double z = 20.50;

System.out.println(x);
System.out.println(y);
System.out.println(z);
-----------------------------------------------------------------------------------
---
Boolean
-----------------------------------------------------------------------------------
---
boolean isworking;
isworking = true;

System.out.println(isworking);
-----------------------------------------------------------------------------------
---
Character
-----------------------------------------------------------------------------------
---
char gender;
gender = 'M';
System.out.println(gender);
-----------------------------------------------------------------------------------
----
Counting No. of chars in a String using : length()
-----------------------------------------------------------------------------------
--

String str = "QEdge";


System.out.println(str.length());

-----------------------------------------------------------------------------------
--
Capturing char present at specified position using : charAt()
-----------------------------------------------------------------------------------
--

String str = "QEdge";


char x = str.charAt(0);
System.out.println(x);

-----------------------------------------------------------------------------------
----
Converting a String to LowerCase and UpperCase using : toLowerCase() and
toUpperCase()
-----------------------------------------------------------------------------------
-----

String str = "QEdge";

System.out.println(str.toLowerCase());
System.out.println(str.toUpperCase());

-----------------------------------------------------------------------------------
--
Comparing two Strings using : equals()
-----------------------------------------------------------------------------------
--
String exptitle,acttitle;

exptitle = "Google";
acttitle = "google";

System.out.println(exptitle.equals(acttitle));

output : false
-----------------------------------------------------------------------------------
-
Comparing two Strings using : equalsIgnoreCase()
-----------------------------------------------------------------------------------
-

String exptitle,acttitle;

exptitle = "Google";
acttitle = "google";

System.out.println(exptitle.equalsIgnoreCase(acttitle));
output : true
-----------------------------------------------------------------------------------
--
Checking a String contains another String or not using : contains()
-----------------------------------------------------------------------------------
---
String expurl,acturl;

expurl = "gmail";
acturl = "https://www.google.com/intl/en-GB/gmail/about/";

System.out.println(acturl.contains(expurl));
output: true
-----------------------------------------------------------------------------------
----

You might also like