└── String /String: -------------------------------------------------------------------------------- 1 | 2 | public class Main 3 | { 4 | public static void main(String[] args) { 5 | String str="maDaM"; 6 | System.out.println("The String is "+str); 7 | int count=0; 8 | for(char i:str.toCharArray()) 9 | { 10 | count++; 11 | } 12 | System.out.println("The string length is "+count); 13 | int lower=0; 14 | for(int i=0;i='a'&&ch<='z'||ch>='A'&&ch<='Z') 18 | { 19 | lower++; 20 | } 21 | System.out.print((char)(str.charAt(i)-32)); 22 | } 23 | System.out.println(); 24 | 25 | if(lower==count) 26 | { 27 | System.out.println("Its a lower case string input"); 28 | } 29 | else{ 30 | System.out.println("Its not a lower case string input"); 31 | } 32 | String s=""; 33 | for(int i=count-1;i>=0;i--) 34 | { 35 | s=s+str.charAt(i); 36 | 37 | } 38 | System.out.println("the reverse is "+s); 39 | if(str.contains(s)) 40 | { 41 | System.out.println("both are equal"); 42 | } 43 | else{ 44 | System.out.println("both are not equal"); 45 | } 46 | } 47 | } 48 | --------------------------------------------------------------------------------