fork download
  1. public class Test {
  2. public void m1(String arg1) {
  3. arg1="Test";
  4. }
  5. public static void main(String[] args) {
  6. Test test1= new Test();
  7. String s= "Hello";
  8. test1.m1(s);
  9. System.out.println(s); }
  10. }
  11.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
public class Test {
    public void  m1(String arg1)  {
        arg1="Test";
    }
 public static void main(String[] args) {
        Test test1= new Test();
        String s= "Hello";
        test1.m1(s);
        System.out.println(s);  }
}

compilation info
Main.java:1: error: class Test is public, should be declared in a file named Test.java
public class Test {
       ^
1 error
stdout
Standard output is empty