import java.io.*; public class VstupRetezce { public static String ctiRetezec() { String nacteno = ""; try { byte[] pole = new byte[100]; System.in.read(pole); nacteno = new String(pole).trim(); } catch (IOException e) { System.out.println("Chyba cteni"); } return nacteno; } public static void main(String[] argv) { System.out.print("Zadej retezec: "); String s = ctiRetezec(); System.out.println("Zadal jsi: " + s); } }