/* *Mar 3 2000 *Demonstrates changing info of an object through its methods *Related Files: TheX.java, filevals.txt *As/of March 7th takes an argument to set x to a particular number upon call. *a/o mar 15th won't find the thex class >> fixed mar 22: classpath set wrong, changed to .; *4/4: Stable *4/14: takes a file arg and sets x to the first num in file. stable xcpt for null pointer err */ import java.io.*; class NewX { public static void main(String args[]) { TheX myx=new TheX(5); myx.printX(); int newVal=1; String theFile=null; if (args.length >0 ) { theFile=args[0]; newVal=0; } else { newVal=314; } if (newVal!=0){myx.setX(newVal);} else {myx.getFileX(theFile);} myx.printX(); } }