Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Comments of the given interface

 
Olivier Gregoire
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,


I received my assignment about two weeks ago, and I have only read it so far (lack of time). However, I was wondering if we may (or not) rewrite the comments of the given interface to make them standard javadocs? I don't want to stupidly lose points because I reformatted them; but if I have the possibility, I'd better reformat it completely.
 
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
Hi Olivier,

Welcome to the JavaRanch and good luck with your assignment!

Because I created my own interface (which extends Sun interface to meet the must requirement) I left the comments in the given interface as-is and overrode all methods from the given interface and in my interface I added my javadoc comments.
I think you can change the comments into javadoc style in Sun's interface as long as you don't change any method signatures of course.

Kind regards,
Roel
 
Harry Henriques
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Roel,

The quote below is an excerpt from the SCJD assignment which I downloaded on December 15th.


Sun Certified Developer for the Java 2 Platform: Application Submission (Version 2.2.3)

Bodgitt and Scarper, LLC.

Server

Required Interface

Your data access class must be called "Data.java", must be in a package called "suncertify.db", and must implement the following interface:

package suncertify.db;
public interface DBAccess
{




I have added some public methods to my Data class implementation (getters) that I want to use when I invoke getSingleton() and receive the instance of my Data class. So, I extended the DBAccess interface, and declared the getters in the extended interface. My question is the following: does my Data class have to directly implement the DBAccess interface? I don't have a must requirement to extend the DBAccess interface. May I extend the interface anyway?

Thanks,

Harry
 
Olivier Gregoire
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roel De Nijs wrote:Hi Olivier,

Welcome to the JavaRanch and good luck with your assignment!

Because I created my own interface (which extends Sun interface to meet the must requirement) I left the comments in the given interface as-is and overrode all methods from the given interface and in my interface I added my javadoc comments.
I think you can change the comments into javadoc style in Sun's interface as long as you don't change any method signatures of course.

Kind regards,
Roel


Thank you for your response!

Of course, I don't change any method signatures and I don't add/remove methods.

Regards,
Olivier
 
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
Hi all,

This is what I did (and I, and many others, did pass with this approach):So you are not violating any must requirement, because your Data class is implementing DBAccess. The test (Data instanceof DBAccess) will always return true.

@Olivier: no need to quote an entire post. just use it to quote 1 or 2 sentences which you want to refer to in your reply.

Kind regards,
Roel
 
Harry Henriques
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Roel. I did what you did.

Regards,

Harry
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic