Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

classpath problem.

 
sharma ishu
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Given the following directory structure:

test-|

|-GetJar.java

-myApp-|

|-Foo.java

And given the contents of GetJar.java and Foo.java:

public class GetJar{
public static void main(String[] args){
System.out.println(myApp.Foo.d);
}
}

package myApp;
public Foo{ public static int d=8;}

The cirrent directory is "test", and myApp/Foo.class is placed in aJAR file called MyJar.jar located in test.

How did the following invocation work?

java GetJar

This is question number 11 from chapter 10 of book "SCJP 6 by Kethy and Bates".
Please answer my question.
 
gurpeet singh
Ranch Hand
Posts: 924
1
Fedora Java Netbeans IDE
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic