Skip to content

Commit a59030a

Browse files
authored
Merge pull request eugenp#10797 from KarthickSridhar/article_javadoc_method_reference
[ BAEL-4254 ] Referencing a method in JavaDoc comment.
2 parents 5e83360 + 7860d84 commit a59030a

4 files changed

Lines changed: 83 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.baeldung.javadocmemberreference;
2+
3+
public class Animal {
4+
5+
public void run() {
6+
7+
}
8+
9+
public void run(String direction) {
10+
11+
}
12+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
package com.baeldung.javadocmemberreference;
2+
3+
import com.baeldung.vehicle.Car;
4+
5+
public class Person {
6+
7+
Person() {
8+
9+
}
10+
11+
/**
12+
* Also, check the {@link #move() Move} method for more movement details.
13+
*/
14+
public void walk() {
15+
16+
}
17+
18+
/**
19+
* Check this {@link #move(String) Move} method for direction oriented movement.
20+
*/
21+
public void move() {
22+
23+
}
24+
25+
public void move(String direction) {
26+
27+
}
28+
29+
/**
30+
* Additionally, check this {@link Animal#run(String) Run} method for direction based run.
31+
*/
32+
public void run() {
33+
34+
}
35+
36+
/**
37+
* Also consider checking {@link com.baeldung.vehicle.Vehicle#Vehicle() Vehicle} constructor to initialize vehicle object.
38+
*/
39+
public void goToWork() {
40+
41+
}
42+
43+
/**
44+
* Have a look at {@link Car#getNumberOfSeats() SeatsAvailability} method for checking the available seats needed for driving.
45+
*/
46+
public void drive() {
47+
48+
}
49+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.baeldung.vehicle;
2+
3+
public class Car {
4+
5+
public Car() {
6+
7+
}
8+
9+
public static int getNumberOfSeats() {
10+
int availableSeats = 0;
11+
// available seats calculation logic
12+
return availableSeats;
13+
}
14+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.baeldung.vehicle;
2+
3+
public class Vehicle {
4+
5+
public Vehicle() {
6+
7+
}
8+
}

0 commit comments

Comments
 (0)