Advertisement
ivana_andreevska

Citanje

Aug 10th, 2022
929
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1. VO METODOT NI E DADEN NEKAKOV INPUT STREAM NO NE NI E SPECIFICIRANO OD KADE
  2.  public static void readDataWithScanner(InputStream inputStream) {
  3.         int lines = 0;
  4.         int words = 0;
  5.         int chars = 0;
  6.         Scanner scanner = new Scanner(inputStream);
  7. SCANNEROT DA NE E OD SYSMTE.IN TUKU OD SOODVENIOT INPUT STREAM
  8.  
  9. ODLUCUVAM OD KADE KE CITAM KOGA KE GO POVIKAM METODOT VO MAIN(DALI SO FILE INPUT STREAM ILI OBICEN INPUT STREAM)
  10.  File file=new File("C:\\Users\\User\\Desktop\\Napredno Sept\\src\\AV5\\dat");
  11.  
  12.         readDataWithScanner(new FileInputStream(file));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement