Adding java string basic methods

This commit is contained in:
Mayank Agarwal
2023-03-04 00:15:35 +05:30
parent db023b8db8
commit b59fdf2e29
2 changed files with 80 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
import java.util.*;
public class JavaContinue {
public static void main(String[] args) {
String str1 = "Hello, World!";
String str2 = new String("Hello, World!");
}
public static void stringPool() {
String str1 = "Hello, World!";
String str2 = "Hello, World!";
}
public static void accessingStringData(String[] args) {
String str = "Hello, World!";
char firstChar = str.charAt(0);
}
public static void manipulateString(String[] args) {
String str1 = "Hello, ";
String str2 = "World!";
String result = str1 + str2;
String str = "Hello, World!";
String upperCaseStr = str.toUpperCase();
String lowerCaseStr = str.toLowerCase();
}
}