Skip to content

Instantly share code, notes, and snippets.

View ishandevshukl's full-sized avatar

Ishan Dev Shukl ishandevshukl

View GitHub Profile
package basics;
public class StringClass {
public static void main(String[] args) {
String sWebsitename = "ishandevshukl.com";
/*As with any other object, we can also create String objects by using
the new keyword and a constructor.*/
package basics;
public class Constructors {
public static class Tree
{
//Class Member Variables & Fields
/* Turning class variables private makes them inaccessible from the other classes.*/
private String sName;
@ishandevshukl
ishandevshukl / ClassesObjects.java
Created March 25, 2018 08:17
Classes and Objects in Java
package basics;
public class ClassesObjects {
public static class Motorbike
{
//Class Member Variables & Fields
String sModel;
int iGear;
int iHighestSpeed;
package basics;
public class Loops {
public static void main(String[] args) {
// For Loop This will print: 0,1,2,3,4,5
for(int i = 0; i<=5; i++){
System.out.println("Output is:" + i );
}
package basics;
public class Arrays {
public static void main(String[] args) {
String [] aDays = {"Monday","Tuesday","Wednesday","Thursday","Friday"};
//This is to store the size of the Array
int iLength = aDays.length;
System.out.println("Length of the Array aDays is: " + iLength);
@ishandevshukl
ishandevshukl / Operators.java
Created March 22, 2018 15:55
Operators in Java
package basics;
public class Operators{
//Assignment Operators
static int iSpeed = 80;
// Assign iSpeed variable value '80'
static int iDistance = 20;
static int iTime = 10;
static String sName = "Automation Testing using Selenium in Java";
@ishandevshukl
ishandevshukl / screenshot.java
Created March 20, 2018 16:18
How to take Screenshots in Selenium
/*
*
*
* Logger Documentation:
* To take Screenshot anywhere in framework just use:
* utility.Screenshot.captureScreenshot(driver);
* Screenshot will be saved in directory: C:/selenium
*
*
*/
@ishandevshukl
ishandevshukl / Airtel_Wynk_4296.java
Last active August 31, 2017 13:48
Solution to Airtel_Wynk_4296
package learnjava;
public class Airtel_Wynk_4296 {
public static void main(String[] args) {
int number=4296; // = some int
int sum = 0;
int a = 9;
while (number != 0) {
int digit= number%10;
sum += digit;
if (digit <a ){