Tuesday, 21 January 2025

Write a Java program to print length of a string “COLLEGE”.

Write a Java program to print length of a string “COLLEGE”. 

class string1 

public static void main(String args[ ]) 

String s1 = new String("College"); 

System.out.println("Original String : "+s1); 

System.out.println("Length of a String : "+s1.length()); 

No comments:

Post a Comment