Skip to content

Instantly share code, notes, and snippets.

View MrRahulR's full-sized avatar
Time

<rahulr/> MrRahulR

Time
View GitHub Profile
@MrRahulR
MrRahulR / Demo.java
Last active June 3, 2021 19:55
Demo.java
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
/*
Output :
Hello World!
*/
@MrRahulR
MrRahulR / VariableDemo.java
Last active May 25, 2021 16:44
VariableDemo,java
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;
@MrRahulR
MrRahulR / TypeDemo.java
Created May 25, 2021 16:49
TypeDemo.java
public class TypeDemo {
int a = 20; // instance variable
static String color = "blue"; // static variable
void method() {
int x = 30; // local variable
}
}
@MrRahulR
MrRahulR / Demo.feature
Created May 25, 2021 17:40
Demo.feature
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.
@MrRahulR
MrRahulR / ArithmaticOperators.java
Created May 27, 2021 13:40
ArithmaticOperators.java
package com.qacaffe;
import java.util.Scanner;
public class ArithmeticOperator {
public static void main(String[] args) {
//Variable declaration section
int a, b;
@MrRahulR
MrRahulR / AssignmentOperators.java
Created May 27, 2021 13:44
AssignmentOperators.java
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;
@MrRahulR
MrRahulR / RelationalOperators.java
Created May 29, 2021 10:01
RelationalOperators.java
package com.qacaffe;
import java.util.Scanner;
public class RelationalOperators {
public static void main(String[] args) {
//Variable declaration section
int a, b;
@MrRahulR
MrRahulR / LogicalOperator.java
Created May 29, 2021 10:11
LogicalOperator.java
package com.qacaffe;
public class LogicalOperator {
public static void main(String[] args) {
//Variable Declaration
int a = 1;
int b = 2;
//Logical Operators
@MrRahulR
MrRahulR / IncrementDecrementOperator.java
Created May 29, 2021 10:18
IncrementDecrementOperator.java
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.
@MrRahulR
MrRahulR / Greetings.java
Last active June 5, 2021 13:36
Greetings.java
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 !!!
*/