java:class_file

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
java:class_file [2016/03/18 21:02]
gthanos [Παράδειγμα 2]
java:class_file [2016/03/18 21:04]
gthanos [Παράδειγμα 2]
Line 90: Line 90:
 public class CreateEmptyFile { public class CreateEmptyFile {
   public static void main(String args[]) {   public static void main(String args[]) {
-    if( args.length ​+    if( args.length ​== 0 ) { 
 +      System.out.println("​Insufficient number of arguments!"​);​ 
 +      return; 
 +    } 
 +    File f = new File("​./"​+args[0]);​ 
 +    if( !f.exists() ) { 
 +      f.createNewFile();​ 
 +    }
   }   }
 } }
java/class_file.txt · Last modified: 2017/02/17 07:58 by gthanos