Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java OCA 8 Programmer I Study Guide - Chapter 1 - Review Questions - Queries

 
Saumyaraj Zala
Ranch Hand
Posts: 75
AngularJS Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
14. Given the following class in the file /my/directory/named/A/Bird.java:
INSERT CODE HERE
public class Bird { }
Which of the following replaces INSERT CODE HERE if we compile from /my/directory?
(Choose all that apply)
A. package my.directory.named.a;
B. package my.directory.named.A;
C. package named.a;
D. package named.A;
E. package a;
F. package A;
G. Does not compile

I can make a class as

and compile it from /my/directory as :

then why is D not a correct option?

23. Which of the following are true? (Choose all that apply)
A. javac compiles a .class file into a .java file.
B. javac compiles a .java file into a .bytecode file.
C. javac compiles a .java file into a .class file.
D. Java takes the name of the class as a parameter.
E. Java takes the name of the .bytecode file as a parameter.
F. Java takes the name of the .class file as a parameter.

The name of .class file is same as class name. If D is correct why F is not correct?
 
Ganish Patil
Ranch Hand
Posts: 529
19
Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Netbeans IDE Spring Tomcat Server
  • Likes 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Saumyaraj Zala wrote:then why is D not a correct option?
I think you meant F, because D is the answer already given. Here is the question 14 already discussed link and question 23 discussed link Hope this helps 
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35266
383
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Saumyaraj Zala wrote:then why is D not a correct option?

D is the correct answer for that question. I checked my paper book and it does have D as the answer. Does your book not? And if not, what does your book says is the answer? And what format of the book do you have? (Kindle, etc)

The name of .class file is same as class name. If D is correct why F is not correct?

Becuase the name of a class file is something like Mine.class. D refers to "Mine". F refers to "Mine.class"
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35266
383
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ganish: Oh typo in the original poster's question! Thanks for finding the links to the previous discussion.
 
Ganish Patil
Ranch Hand
Posts: 529
19
Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Netbeans IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne: I would rather thank OP, he made me read that thread else I also thought B, D and F are the correct answers like Brian James.
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ganish Patil wrote:Hope this helps

Have a well deserved cow for providing links to those topics which cover the same questions the OP has doubts about! (Saves me some time as well as I don't need to use the search function )
 
Ganish Patil
Ranch Hand
Posts: 529
19
Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Netbeans IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roel De Nijs wrote:Saves me some time as well as I don't need to use the search function
and also cleared my doubt of Q.14, Thank you
 
Saumyaraj Zala
Ranch Hand
Posts: 75
AngularJS Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys !!
 
Ganish Patil
Ranch Hand
Posts: 529
19
Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Netbeans IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome 
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic