Revision Notes Flashcards
What is a function?
Functions in Java are blocks of code that perform a specific task, and they are used to organize code and make it more modular and reusable.
What is a method in Java?
A method in Java is a block of code that, when called, performs specific actions mentioned in it.
You can insert values or parameters into methods, and they will only be executed when called.
For instance, if you have written instructions to draw a circle in the method, it will do that task.
What is a variable in Java?
In Java, Variables are the data containers that save the data values during Java program execution.
Every Variable in Java is assigned a data type that designates the type and quantity of value it can hold. A variable is a memory location name for the data.
In Java, there are different types of variables, for example:
String - stores text, such as “Hello”. String values are surrounded by double quotes
int - stores integers (whole numbers), without decimals, such as 123 or -123
float - stores floating point numbers, with decimals, such as 19.99 or -19.99
char - stores single characters, such as ‘a’ or ‘B’. Char values are surrounded by single quotes
boolean - stores values with two states: true or false
What is a constant in Java?
In Java, a constant is a variable whose value cannot be changed once it’s assigned.
Constants are often used to represent values that will not change, such as the number of students in a class.
What is indentation?
In programming, indentation is just like formatting. It is used to make the code readable to other users because it makes the code easier to edit, displays how the braces match up, and shows the logic of the program in well-organized fashion
What is a Class?
In Java, a class is a blueprint or template for creating objects. It defines the attributes (fields) and behaviors (methods) that objects of that class will have. Classes are the fundamental building blocks of object-oriented programming in Java.
What is an object?
An object in Java is a basic unit of Object-Oriented Programming and represents real-life entities.
Objects are the instances of a class that are created to use the attributes and methods of a class. A typical Java program creates many objects, which interact by invoking methods.
What is an Argument?
A data item specified in a method call. An argument can be a literal value, a variable, or an expression.
What is an Array?
A collection of data items, all of the same type, in which each item’s position is uniquely designated by an integer.
What is a comment?
Explanatory text that is ignored by the compiler. In programs written in the Java(TM) programming language, comments are delimited using // or /…/.
What is a parameter?
A parameter is essentially a variable of a given type (String, int, Boolean etc) when you call the method/function, you must pass an a value to this variable.
What is white box testing?
In white box testing, the tester has knowledge of the internal workings of the item being tested. They use this information to select test cases that cover the complete scope of the program, including branches, loops, and specific lines of code.
What is black box testing?
Black box testing is a software testing technique where the internal workings or implementation details of the software being tested are not known to the tester. Instead, the tester focuses solely on the inputs and outputs of the software, treating it as a “black box” with no visibility into its internal structure, algorithms, or code.
In black box testing, the tester designs test cases based on the specifications, requirements, or functional behavior of the software. These test cases are then executed against the software, and the results are compared against expected outcomes to identify defects, errors, or deviations from the desired behavior.
Black box testing is useful for assessing the functionality, usability, and reliability of the software from an end-user perspective. It helps uncover issues related to incorrect or unexpected behavior, boundary conditions, error handling, and interoperability without requiring knowledge of the software’s internal logic or implementation details.
What is a syntax error?
A syntax error in programming is a mistake in the code that violates the rules of the programming language. It’s like a grammatical error in writing.
For example, if you forget a semicolon at the end of a statement or misspell a keyword, the program won’t understand what to do. These errors need to be fixed before the program can run correctly
What is a logic error?