Postingan

Menampilkan postingan dari Mei, 2022

Java ReadFileFrom URL

  import java . util . Scanner ; public class ReadFileFromURL {     public static void main ( String [] args ) {         System . out . println ( " Masukan url " );         String URLString   = new Scanner ( System . in ). next ();         try {             java . net . URL url = new java . net . URL ( URLString );             int count = 0 ;             Scanner input = new Scanner ( url . openStream ());             while (input . hasNext () ){                 String line = input . nextLine ();                 count += line . length ();             }             System . out . println ( " Berapa karakter : " + count );   ...