comp sci methods Flashcards
What is the type of method that is used to either print to display or perform some action in the background that we don’t need to see the result for.
void methods
Methods that do not have print statements in them and perform some function and send the results back to the line of code that called it.
return methods
Which type of method do we use a variable type instead of void that needs to match the value the method is sending back.
return methods
What type of method needs to end with a return statement using the word ‘return’ followed by what we want to send back.
return methods
What method do we have to store in a variable or print statement since it sends back information.
return methods
What do you call the provided value of a method?
parameter
Errors in the actual Java code itself is called…
compile error
what format do errors come in?
file, line, and type
“___ expected”
An error meaning that Java believes that there is a missing symbol in your code.
“illegal start of expression” or “reached end of file”
Usually means that there is a mismatch in curly braces {}
“public class ___ should be in file”
Occurs when the class and the java filename do not match.
“cannot find symbol”
1) The spelling of a var or method may not match from when it was created
2)You may be truing to use a var or method that was never declared in the first place
3) The var does not exist in that part of the program(like looking for an i outside of a for loop)
4)you may be missing an import that is needed
“incompatible types”
Often happens when the code tries to place one type of value into a variable of another type like putting a string into an int.
“missing return statement”
Occurs when a return method does not have a return statement or when there is a return only inside of a loop or an if-statement because you must include a return outside of these.
“unreachable statement”
Occurs when a statement is written in a place that prevents it from being executed and is usually after a break or return statement.