Ulf Dittmer wrote:There seems to be a disconnect between the question I asked, and the answer you gave, so I'm still not sure why you are allowing the user to overwrite the file. If you store it in Internal Storage, then no other app can get at it.
Ulf Dittmer wrote:If you don't want to overwrite an existing file, why are you allowing the user to do so?
Devika Panchasara wrote:hi,
i am planning to give this OCA 7 exam next month...... but very confused because no proper material. can anyone help me please?
i had worked in java in my college, tht was before one year.. ...rit now all seems blank and m feeling like "OMG WHR IS THE WAY?"
Campbell Ritchie wrote:What instruction are you using to execute Test? You need to give its fully‑qualified name.
Henry Wong wrote:
simon fletcher wrote:The textbook I am using says that with Java 7 the CLASSPATH doesn't have to be defined. Is this true? I haven't had much luck importing any packages I have created myself. This makes me think I should have CLASSPATH defined, and that I am misinterpretting what the textbook is saying.
Well, yeah, you don't have to define a CLASSPATH variable, but that is not specific to Java 7. Even older versions of Java allowed usage without the CLASSPATH environment variable assigned. If you don't have the environment variable assigned, you can set its value as parameters to the java and javac commands. And if you don't want to do that, you can always locate your files so that it will work -- since the default is to have the current directory as the classpath.
Jelle Klap wrote:The way you invoke readObject() is guaranteed to throw an EOFException:
ObjectInputStream Javadoc wrote:
Any attempt to read object data which exceeds the boundaries of the custom data written by the corresponding writeObject method will cause an OptionalDataException to be thrown with an eof field value of true. Non-object reads which exceed the end of the allotted data will reflect the end of data in the same way that they would indicate the end of the stream: bytewise reads will return -1 as the byte read or number of bytes read, and primitive reads will throw EOFExceptions.
My bet is that the the getMessage() call in your catch block returns null. Try adding ex.printStackTrace(); to the catch block to find out.