Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I might warn you about some little points about the Path Interface. Also, I would have two suggestions for implementing this interface.</p> <p>To my knowledge, Path Interface is there to create a type reference point for the paths in file operator objects. A Path can be created with Paths Helper Class (pay attention to -s). But, it is never implemented by any class. Thus, it is an interface that is used for passing data within a common type. This means that, coder is supposed to send information using Path Interface as the type, then use the Path Typed Object on other class operation that is declared as receiving Path Type Object. As a result, ,in my opinion, implementing path class is not really a necessity. </p> <p>As I mentioned, I can suggest you two things: Though, these type of practices are not good design decisions. This issue is also mentioned in JavaSE7 Doc: <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html#toAbsolutePath%28%29" rel="nofollow">here</a></p> <p>1) First, you don't have to add behavior to all methods in the interface. You can declare them with a "not implemented" msg log and return nulls. </p> <p>2) But a better way is to use an abstract class as Ali Alamiri mentioned. I personally would not go into the fuss to create a subclass for the abstract and just implement the methods that I want. If I want to make more fault tolerant app of it, then use the subclass to carry all unimplemented methods and use a warning msg log for all of them.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload