Where should I write the javaDoc comments? [duplicate] - java

This question already has answers here:
Class or variable not found
(2 answers)
Should Javadoc comments be added to the implementation?
(7 answers)
Closed 5 years ago.
I'm creating the javadoc of my project, but i'm not sure where should i write it.
I have all the javaDoc implemented in my interfaces. And I have classes implementing these interfaces (and not adding extra-methods). So, Is there any command to copy the javadoc from the interfaces to my classes? Or should i Copy-paste from my interfaces to the implementation?

Related

Where is the logic for annotations in java? How are two annotations different from each other? [duplicate]

This question already has answers here:
Understanding annotation in Java
(3 answers)
What do annotations do? And how do I use it? [duplicate]
(2 answers)
Closed 7 months ago.
The community reviewed whether to reopen this question 7 months ago and left it closed:
Original close reason(s) were not resolved
I mean I know that it provides metadata and special instructions to the compiler but where is the logic for that? How are two annotations different if both of them has same body? The source code for #Id, #Override and #Embeddable is same but how do they work differently when they don't have any code in them. Also, if we can't see the code/logic then how can I create my own annotation with specific functionality?

Run Time Polymorphism in Java Collection framework [duplicate]

This question already has answers here:
What does it mean to "program to an interface"?
(33 answers)
Java - declaring from Interface type instead of Class
(7 answers)
Closed 11 months ago.
Set set= new TreeSet<>();
vs
TreeSet set= new TreeSet<>();
I know we are using the concept of run time polymorphism here, but what is the use of writing this? Is there any advantage to writing one thing over another? both are giving me the correct results. I am learning java right now, help would be great.

Java method().method().method(); How to do this? [duplicate]

This question already has answers here:
How to achieve method chaining in Java?
(4 answers)
Closed 3 years ago.
For example how do I do this?
getServer().getManager().registerNewUser(arguments);
and
getServer().getStats().user(arguments);
Stuff like this, I've tried searching the web but I cant find any tutorials on this,so I'm asking here.
In OOP, in general, this concept is called class composition more on this you can find it here https://en.wikipedia.org/wiki/Object_composition
Also for java and the difference between Composition and inheritance https://www.baeldung.com/java-inheritance-composition

Why do we not instantiate the filesystem class like other classes using the new keyword? [duplicate]

This question already has answers here:
How come an abstract class "DocumentBuilderFactory" allowed to instantiate new instance
(4 answers)
Constructors vs Factory Methods [closed]
(10 answers)
Closed 4 years ago.
I am doing some Java homework and we are currently studying IO and files in java.
In the directions it asks for us to instantiate a filesystem class. However this doesn't seem possible without using the following syntax. How can I better understand this?
FileSystem fs = FileSystems.getDefault();
Thanks for any help.

Array class code [duplicate]

This question already has answers here:
Where can I find the Java JDK source code? [closed]
(11 answers)
Closed 6 years ago.
In java, is there any way to access the methods to classes that already you import? For example, is there a way to view the code for all the methods used for arrays? Such as the constructors, add(), remove(), size()? I have checked oracle, but there is no code, only method names and parameters. I understand how the methods work, but i'd like to see the actual code used.
Search for the JDK source code, depending on the version you want.

Categories