05-12-2015, 07:56 PM
So, I'm a Software Engineer who programs in Java. I got bored and decided to look over their practice problems and found 4 broken test questions.
2) The name System can be used. The pre-existing System is in the java.lang package, but someone could create their own System class in any package with another name and use it fine.
If you create a "System" class inside your own package named "java.lang" you immediately lose access to the pre existing "System" class though.
9) Does not show "the method below", making it impossible to answer.
16) The purpose of the File class is to get access to file on the disk. It cannot store data on the disk, you would need FileWriter, BufferedWriter, etc.. To store data on the disk. The File class allows you to check a file's permissions, delete a file, create an empty file, see if a file exists, and a hand full of other features, none of which allow you to write to the file.
18) This answer isn't entirely true. I just tested this with a BufferedWriter and as long as you use the "flush" method, which puts your data into the file and saves the file, then your data will be saved fine, so using the "close" method isn't needed to save the data. This is because the "close" and "flush" methods both use the "flushBuffer" method to save data.
I really wish companies would check their tests more thoroughly...
2) The name System can be used. The pre-existing System is in the java.lang package, but someone could create their own System class in any package with another name and use it fine.
If you create a "System" class inside your own package named "java.lang" you immediately lose access to the pre existing "System" class though.
9) Does not show "the method below", making it impossible to answer.
16) The purpose of the File class is to get access to file on the disk. It cannot store data on the disk, you would need FileWriter, BufferedWriter, etc.. To store data on the disk. The File class allows you to check a file's permissions, delete a file, create an empty file, see if a file exists, and a hand full of other features, none of which allow you to write to the file.
18) This answer isn't entirely true. I just tested this with a BufferedWriter and as long as you use the "flush" method, which puts your data into the file and saves the file, then your data will be saved fine, so using the "close" method isn't needed to save the data. This is because the "close" and "flush" methods both use the "flushBuffer" method to save data.
I really wish companies would check their tests more thoroughly...
I'm a 19 year old, Software Engineer, who is enrolled at TESC for a B.A. in Computer Science. My bachelors coursework is completed and I am waiting for graduation to roll around. Will start pursuing ALM in Information Technology with a concentration in Software Engineering from Harvard Extension School sometime in the coming year.