I don't think there is a way to print the '-------' other than typing it, but what you can do is create your own method to print line breaks for future references like :-
class TextBreak {
void dash(int n) {
StringBuilder sb = new StringBuilder();
while (n > 0) {
sb.append("-"); // can be changed to print dash with multiples of number
n--;
}
System.out.println(sb);
}
void dash() { // For default length for line break
int n = 5;
StringBuilder sb = new StringBuilder();
while(n > 0) {
sb.append("-");
n--;
}
System.out.println(sb);
}
}
Then you can use it for future references by creating an object of the class TextBreak and using the method dash (with or without length arg) to have your line break.
Like :-
class LineBreak {
public static void main(String args[]) {
TextBreak tb = new TextBreak();
tb.dash(4); // With length argument
tb.dash(); // Without argument
}
}