Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pl.wsis.java;
- public class Zad1 {
- // Napisz metodę, która jako parametr będzie przyjmowała napis i wypisywałą na standardowe wyjście jego długość
- public void wypiszDlugosc(String tekst) {
- System.out.println("Długość tekstu to: " + tekst.length());
- }
- // 5.
- public static void main(String[] args) throws Exception {
- Zad1 zad1 = new Zad1();
- try {
- zad1.wypiszDlugosc(null);
- } catch (Exception ex) {
- ex.printStackTrace();
- throw new Exception();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement