DEV Community

Cover image for One Commit at a Time ! Series - 18
Annapoorani Kadhiravan
Annapoorani Kadhiravan

Posted on

One Commit at a Time ! Series - 18

JAVA

public class Main {
  public static void main(String[] args) {
    String txt = "Hello World";
    System.out.println(txt.toUpperCase());
    System.out.println(txt.toLowerCase());
  }
}
Enter fullscreen mode Exit fullscreen mode

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 a String variable named txt containing 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 original txt variable 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';
Enter fullscreen mode Exit fullscreen mode

References :
https://www.w3schools.com/sql/sql_where.asp
https://www.w3schools.com/java/java_examples.asp

Top comments (0)