Thirumal R
Thirumal R

Reputation: 1

Facing issue with classpath variable in Java

/home/thiru/VS Code Files/Java Files
├── F
│   ├── test.class
│   └── test.java
└── G
    ├── c.class
    └── c.java

c.java imports F package and has main function

When I use javac and java :

When I simply use java command :

test.java :

package F;

public class test{

    public static void d(){
        System.out.println("Thirumal");
    }

}

c.java :

import F.test;

public class c{

    public static void main(String[] args){
        test.d();
    }
}

What's the difference?

Upvotes: 0

Views: 59

Answers (0)

Related Questions