Last active
August 6, 2024 07:10
-
-
Save sunmeat/236ff0114b3b9e0ee0c5 to your computer and use it in GitHub Desktop.
overloading
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.alex.methods; | |
public class OverloadingExample { | |
static void line(int length, char symbol) { | |
for (int i = 0; i < length; i++) { | |
System.out.print(symbol); | |
} | |
System.out.println(); | |
} | |
static void line(int length) { | |
line(length, '*'); | |
} | |
static void line() { | |
line(10); | |
} | |
public static void main(String[] args) { | |
line(20, '@'); | |
line(15); | |
line(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment