fork download
  1. public class Sample_String {
  2. public static void main(String[] args) {
  3.  
  4. String S1 = "my name is rohan";
  5. String S2 = "is";
  6. string S3 ="rohan"
  7.  
  8.  
  9. int length = S2.length();
  10. System.out.println("Length of a String is: " + length);
  11.  
  12. System.out.println("Length of a String is: " + S2.length());
  13. }
  14. }
  15.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:3: error: expected unqualified-id before ‘public’
   public class Sample_String {
   ^~~~~~
stdout
Standard output is empty