lecture7 - Web Technology for IE 8 October 2003 ISE 582...

Info icon This preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Web Technology for IE 8 October 2003 http://www-classes.usc.edu/engr/ise/582 1 ISE 582: Information Technology for Industrial Engineering Instructor: Elaine Chew University of Southern California Department of Industrial and Systems Engineering Lecture 7 JAVA Cup Seven: It’s All in the Packaging Winston & Narasimhan: Chapt 33-40 8 October 2003 Web Technology for IE 2 JAVA Cup 7 How to Read/Write Objects How to Modularize Programs Creating a Window Drawing Lines in Windows Writing Text in Windows
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Web Technology for IE 8 October 2003 http://www-classes.usc.edu/engr/ise/582 2 8 October 2003 Web Technology for IE 3 Review stream reader buffer stream writer stream reader tokens 8 October 2003 Web Technology for IE 4 Reading / Writing Objects Serialized input-output operations – <obj.o/p.stream>.writeObject(<vector>) – <obj.i/p.stream>.readObject() Indicate intentions to use operations by implements Serializable – throws IOException , ClassNotFoundException Each instance must belong a class that implements the Serializable Interface
Image of page 2
Web Technology for IE 8 October 2003 http://www-classes.usc.edu/engr/ise/582 3 8 October 2003 Web Technology for IE 5 Reading Objects from File FileInputStream fileInputStream = new FileInputStream(“in.data”); ObjectInputStream objectInputStream = new ObjectInputStream( fileInputStream ); Vector <vector> = (Vector) objectInputStream .readObject(); 8 October 2003 Web Technology for IE 6 To Write Objects to File FileOutputStream fileOutputStream = new FileOutputStream(“out.data”); ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream); objectOutputStream.writeObject(<vector>); objectOutputStream.close();
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Web Technology for IE 8 October 2003 http://www-classes.usc.edu/engr/ise/582 4 8 October 2003 Web Technology for IE 7 Modularing Your Program Compilation Units • Packages Setting CLASSPATH Calling Methods from a Module Access to Var/Methods in Package 8 October 2003 Web Technology for IE 8 Compilation Units Define all classes in same file Only one class can be public Only one class is universally accessible Convention: each class has its own compilation unit
Image of page 4
Web Technology for IE 8 October 2003 http://www-classes.usc.edu/engr/ise/582 5 8 October 2003 Web Technology for IE 9 Packages Use single-class compilation units Indicate module using package statement at beginning of each c.u package onto.java.entertainment; Convention: package names consist of components separated by dots 8 October 2003 Web Technology for IE 10 CLASSPATH Package names correspond to paths package onto.java.entertainment; – Files stores in ./onto/java Setting the path – setenv CLASSPATH <path1>:<path2>:.
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern