सीधे मुख्य सामग्री पर जाएं

#38 How to use String in Java ? String का use कैसे करे ? lowercase, uppercase & equal in String

package com.sudhirtheindian2.java123;

public class string_java {
public static void main(String[] args) {

// How to use String in java

// 1 String is a predefined class in java
// but we can also use as a datatype

// 2 String are the sequence of character and
// its index starts from 0

// syntax

//
// 1 String str1 = new String("India");
//
// 2 String str2 = "India"

// String str1 = new String("India");

String str2 = "India";

System.out.println(str2.toLowerCase());

// if(str1.equals(str2)){
// System.out.println("yes both are equal");
// }
// else {
// System.out.println("no both are not equal");
//
// }





// difference
// 1 equals
// 2 length of string
// 3 toupprecase
// 4 tolowercase

}
}

टिप्पणियाँ

इस ब्लॉग से लोकप्रिय पोस्ट