How to use while loop in java

While loop in Java

import java.util.Scanner;

class WhileLoop {
public static void main(String[] args) {
int i;

Scanner input = new Scanner(System.in);
System.out.println(“Please input an integer value”);

while ((i = input.nextInt()) != 0) {
System.out.println(“You have entered ” + i);
System.out.println(“Please input an integer value”);
}

System.out.println(“Gone out of loop”);
}
}

How to implement Multiplication program in java

How to implement Multiplication program in java:

import java.util.Scanner;

class TableForMultiplication
{
public static void main(String args[])
{
int i, j;
System.out.println(“Enter an integer to display it’s multiplication table…”);
Scanner in = new Scanner(System.in);
i = in.nextInt();
System.out.println(“Multiplication table of “+i+” is :-“);

for ( j = 1 ; j <= 10 ; j++ )
System.out.println(i+”*”+j+” = “+(i*j));
}
}

What is AND, OR and NOT Operators in SQL

AND, OR, and NOT operators are combined with the WHERE clause to get the desired filtered results.

 

e.g SELECT * FROM Users

WHERE State =’illinois’ AND City=’Chicago’;

 

e.g SELECT * FROM Users

WHERE City=’Chicago’ OR City=’New York’;

 

e.g SELECT * FROM Users

WHERE NOT State =’Chicago’;

What is SQL WHERE Clause

SQL WHERE clause is used to filter records and its added as below
SELECT States FROM Users where Usersgroup = ‘1’;

Selenium Tutorial 

Karate framework

Selenium features
Selenium features – what are the main features of selenium.
Selenium IDE
How to Validate the XPATH is correct in Selenium automation
How to take snapshot of browser using selenium
How to run selenium on linux server using Firefox binary
How to handle the error popup on site security certificate is not trusted with chrome selenium python automation
How to Implement Maven TestNG Selenium Grid project
How to Install TestNG in Eclipse IDE for Selenium WebDriver automation testing
How to run selenium tests in jenkins
Selenium jenkins integration
Selenium grid hub and node configuration
Protractor vs Selenium
Robot framework and Selenium2Library
Apache poi selenium webdriver supports Selenium projects

Breaking while loop in Java

import java.util.Scanner;

class TestingBreakWhileLoop {
public static void main(String[] args) {
int i;

Scanner input = new Scanner(System.in);

while (true) {
System.out.println(“Input an integer for this test program”);
i = input.nextInt();

if (i == 0) {
break;
}
System.out.println(“You have entered …  ” + i);
}
}
}

What is SQL ORDER BY Keyword

The purpose of ORDER BY keyword is used to sort the results in descending or ascending order

 

e.g SELECT * FROM Users

ORDER BY State DESC;

 

e.g SELECT * FROM Users

ORDER BY State ASC;

 

or

 

SELECT * FROM Users

ORDER BY State;

String reverse using java script split method

Assume given string ‘str’ value is “welcome”
function stringRev(str) {
var splitString = str.split(“”);// Use the reverse() method to reverse the array
var arrayReverse = splitString.reverse(); // equals to [“e”, “m”, “o”, “c”, “l”, “e”, “w”]

// Use join() method to join the elements of the array into a string as below in comments
var joinArray = arrayReverse .join(“”); //  [“e”, “m”, “o”, “c”, “l”, “e”, “w”] to “emoclew”

//Return the reversed string
return joinArray; // “emoclew”
}

stringRev(‘welcome’);

Differences between SQL and PL/SQL

PL/SQL is procedural language where s SQL is data oriented language.
PL/SQL purpose is to create applications but SQL is data manipulator and reviewer
PL/SQL executions works at block of code level while SQL execution is per statement at a time.
PL/SQL servers for building, formatting and display application screens but SQL sources data for that screens.
PL/SQL is procedural based and instructs database on how to do but SQL is declarative level which helps database on what to do.
PL/SQL purpose it to code program blocks, procedures, triggers, functions, and packages but SQL is used to code queries, DCL, DML and DDL statements
SQL can be subset of PL/SQL but PL/SQL can not be subset of SQL
 

 Popular databases or filesystems that uses SQL – Please click here