fork download
  1. class MyClass {
  2. private int anInt = 0;
  3. private int anotherInt = 0;
  4. MyClass(int intOne, int intTwo) {
  5. anInt = intOne;
  6. anotherInt = intTwo;
  7. }
  8. public void myMethod() {
  9. System.out.println("anInt: " + anInt + ", anotherInt: " + anotherInt);
  10. }
  11. }
  12. class MyOtherClass {
  13. public static void main(String [] Args) {
  14. MyClass aClass = new MyClass();
  15. aClass.myMethod();
  16. }
  17. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:14: error: constructor MyClass in class MyClass cannot be applied to given types;
       MyClass aClass = new MyClass();
                        ^
  required: int,int
  found: no arguments
  reason: actual and formal argument lists differ in length
1 error
stdout
Standard output is empty