diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2026-02-16 10:16:31 +0100 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2026-02-16 10:16:31 +0100 |
| commit | 2c530f2a58014e8e9479c41dabff9a639e9297a5 (patch) | |
| tree | fe6f6890d983ff436d80e4194abf5545658f51d6 /semestre 4/java/tme/tp2/AdresseWeb.java | |
| parent | ba6692d9b508b448eafd7bc71faa4ae3f3ac7199 (diff) | |
Diffstat (limited to 'semestre 4/java/tme/tp2/AdresseWeb.java')
| -rw-r--r-- | semestre 4/java/tme/tp2/AdresseWeb.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/semestre 4/java/tme/tp2/AdresseWeb.java b/semestre 4/java/tme/tp2/AdresseWeb.java new file mode 100644 index 0000000..409b61c --- /dev/null +++ b/semestre 4/java/tme/tp2/AdresseWeb.java @@ -0,0 +1,23 @@ +public class AdresseWeb { + private final String protocole; + private final String domaine; + private final String chemin; + + public AdresseWeb(String proto, String dom, String path) { + protocole = proto; + domaine = dom; + chemin = path; + } + + public AdresseWeb(String dom, String path) { + this("http", dom, path); + } + + public AdresseWeb(String dom) { + this("http", dom, ""); + } + + public String toString() { + return protocole + "://www." + domaine + chemin; + } +} |
