I have two files first one is
Welcome.java
package com.project;
import com.code.*;
class Welcome {
public static void main(String[] args) {
Test t = new Test();
System.out.println("the valus is " + t.addition(4,3));
}
}
Test.java
package com.code;
public class Test {
private int a;
private int b;
public Test() {
a=2;
b=3;
}
public int addition(int a, int b) {
return a+b;
}
}
When I compile Welcome.java I got:
error: cannot find symbol
System.out.println("the valus is " + t.addition(4,3));
Cannot find the reason why ? help please
Edit:
I compile with this command:
javac com/project/Welcome.java
Solution:
javac -cp com/code/* com/project/Welcome.java