Ask your own question, for FREE!
Computer Science 16 Online
OpenStudy (anonymous):

please check my Java practice homework

OpenStudy (anonymous):

OpenStudy (anonymous):

i am mostly sure for all of them however I am looking for confirmation :)

OpenStudy (anonymous):

what confuses me is 2 and 4 because shouldn't it be \n to indicate a new line? however the answer choices don't fit that way,

OpenStudy (e.mccormick):

Well, it is possible to print out /t and /n... it is just a string. But it is not generally useful.

OpenStudy (e.mccormick):

For a list of the escape characters: http://www.tutorialspoint.com/java/java_characters.htm

OpenStudy (anonymous):

i know, which makes confused because since i can print /n it's not an error and in question 4 line 2 and 3 are exactly the same

OpenStudy (e.mccormick):

Hmm... it all locked up on me while I was typing. Wheee. I was saying that it depenss on the the type of error. See, there are three types: compile, run, and logic. Compelation errors are things that keep it from compiling. You can't even build the project and need to fix it then. A good example is trying to assign a float to an int. The compiler will stop right there. Run time errors are when it will compile and make a program but when you run it you crash. A good examples id if you iterate through an array and you go past the end of the array. The program will work until that point then give an exception and fail. The final error, a logic error, will let the program run but you get an unexpected or improper result. The use of "/n" for a newline will work, but it won't print a new line. It just prints /n. The generally excepted form of teaching is that when you say errors you mean ALL errors. If you want to limit it to just one type you should limit the question. Because they did not limit things, the questons are being poorly worded.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!