Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

self test doubt  RSS feed

 
saloni jhanwar
Ranch Hand
Posts: 583
Firefox Browser Notepad Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One of the Questions : BOOK K&B 6>PAGE 817

If the current directory is test, and you create a .jar file by invoking this,

A. Foo.java
B. Test.java
C. myApp/Foo.java
D. myApp/Bar.java
E. META-INF/Foo.java
F. META-INF/myApp/Foo.java
G. myApp/myAppSub/Bar.java

then which path names will find a file in the .jar file?

Why A is not correct ?
 
gurpeet singh
Ranch Hand
Posts: 924
1
Fedora Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why you think that A option should be correct ???
 
saloni jhanwar
Ranch Hand
Posts: 583
Firefox Browser Notepad Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
gurpeet singh wrote:why you think that A option should be correct ???


Why it shouldn't be ??
 
gurpeet singh
Ranch Hand
Posts: 924
1
Fedora Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
think about it . you will come to know for yourself. as a hint , what is your current directory and then proceed.
 
saloni jhanwar
Ranch Hand
Posts: 583
Firefox Browser Notepad Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
gurpeet singh wrote:think about it . you will come to know for yourself. as a hint , what is your current directory and then proceed.


Why do you think that MyJar.jar hasn't Foo.java ?
 
gurpeet singh
Ranch Hand
Posts: 924
1
Fedora Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no i'm not thinking that. myjar.jar has definitely got Foo in it. but just think what would be its hierarchy/directory structure in the jar file. if you can try jar -tf myjar.jar to see the structure of the jar. also look at the C option as well. by looking at the option , you can probably make out the difference.
 
saloni jhanwar
Ranch Hand
Posts: 583
Firefox Browser Notepad Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok thanks it was very easy so i got confused.i couldn't believe that.
 
saloni jhanwar
Ranch Hand
Posts: 583
Firefox Browser Notepad Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
gurpeet singh
Ranch Hand
Posts: 924
1
Fedora Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
gurpeet singh
Ranch Hand
Posts: 924
1
Fedora Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is what is difficult in exam . how much you can keep your cool and focus . believe me exam questions are not so tough. but we have to solve them with real exam pressure and all that stuff. good luck and good night
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!