This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HelloWorld { | |
public static void main(String[] args) { | |
System.out.println("Hello World!"); | |
} | |
} | |
/* | |
Output : | |
Hello World! | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class VariableDemo { | |
public static void main(String[] args) { | |
double profit, principle = 1000, interestRate = 0.0625; // it is possible to initialize at creation time | |
int numOfYears = 5; | |
// Calculate profit after the given number of years | |
// Notice that until this point, profit is still uninitialized | |
profit = principle * interestRate * numOfYears; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TypeDemo { | |
int a = 20; // instance variable | |
static String color = "blue"; // static variable | |
void method() { | |
int x = 30; // local variable | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Sign up in Gmail | |
Scenario: User can signup in gmail successfully. | |
If user is new the it should greet user for the new account and also show its features. | |
Given I chooses to Sign up. | |
When I sign up with valid credentials. | |
Then I should redirect to my gmail inbox. | |
And I should see current list of my emails in inbox. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.qacaffe; | |
import java.util.Scanner; | |
public class ArithmeticOperator { | |
public static void main(String[] args) { | |
//Variable declaration section | |
int a, b; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.qacaffe; | |
import java.util.Scanner; | |
public class AssignmentOperators { | |
public static void main(String[] args) { | |
int number = 10; | |
long contactNo = 12313424; | |
String name = "Rutu Shah"; | |
double average = 77.8; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.qacaffe; | |
import java.util.Scanner; | |
public class RelationalOperators { | |
public static void main(String[] args) { | |
//Variable declaration section | |
int a, b; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.qacaffe; | |
public class LogicalOperator { | |
public static void main(String[] args) { | |
//Variable Declaration | |
int a = 1; | |
int b = 2; | |
//Logical Operators |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class IncrementDecrementOperator { | |
public static void main(String[] args) { | |
int a; | |
//Scanner class object which is used to take input from the user. | |
Scanner scanner = new Scanner(System.in); | |
//Take value of "a" from the user. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Greetings { | |
public static void main(String[] args) { | |
System.out.println("Welcome to main method in java !!!"); | |
} | |
} | |
/* | |
Output : | |
Welcome to main method in java !!! | |
*/ |
OlderNewer