JAVA
public class Main {
public static void main(String[] args) {
String txt = "Hello World";
System.out.println(txt.toUpperCase());
System.out.println(txt.toLowerCase());
}
}
Explanation :
This Java program demonstrates how to transform the casing of characters in a string using built-in string methods.
-
public class Main: The container class required by Java to hold the executable code. -
public static void main(String[] args): The main entry point where program execution begins. -
String txt = "Hello World";: Creates aStringvariable namedtxtcontaining the characters"Hello World". -
txt.toUpperCase(): Returns a new string with every letter converted to uppercase ("HELLO WORLD"). -
txt.toLowerCase(): Returns a new string with every letter converted to lowercase ("hello world"). -
System.out.println(...): Prints each converted string to the console on a new line, leaving the originaltxtvariable unchanged since strings in Java are immutable.
SQL
WHERE Clause
The WHERE clause is used to filter records.
The WHERE clause is used to extract only those records that fulfill a specific condition.
Example
Here we select all customers from Mexico:
SELECT * FROM Customers
WHERE Country = 'Mexico';
References :
https://www.w3schools.com/sql/sql_where.asp
https://www.w3schools.com/java/java_examples.asp
Top comments (0)