print
Advertisment
Advertisment

Simple Program

Example 2

public class Raj   
{    
    public static void main(String[] args) {    
        String string = "The best of both worlds";    
        
     System.out.println("Total number of characters in a string: " + string);    
    }    
}         

Output :

 
   
  Total number of characters in a string: 
   
Advertisment
Advertisment
arrow_upward