The Java program compiled and ran. It also failed every pupil who scored exactly 60. A small detail, unless you scored exactly 60.
Follow one short Java example to see how programmers talk about code, then use the 24-term glossary to look up unfamiliar words.
Argument or Parameter?
The pass mark is 60. These two lines go inside a method, such as main.
int[] scores = {58, 60, 72};
int total = countPassed(scores, 60); // returns 2Here’s the method they call. It belongs in the same class.
static int countPassed(int[] scores, int passMark) {
int passed = 0;
for (int score : scores) {
if (score >= passMark) {
passed++;
}
}
return passed;
}In the method definition, scores and passMark are parameters. In the call, the array referenced by scores and the value 60 are the arguments you pass in. The method returns 2, and the call stores that result in total.
Read the loop aloud: “Loop through the array. On each iteration, check one score. If it meets the pass mark, increment the count. Return the total.” Try it with 58, 60 and 72.
Keywords
Java reserves words such as int, boolean, if, else, for, while, switch, class, public and return. Each has a role in the language. In Python, bool is the name of a built-in type.
Different Types of Errors
Logic error. Change score >= passMark to score > passMark and the method returns 1. The program runs, but the comparison excludes the pupil who scored 60.
Syntax error. Leave the closing quote off a Java string and the code breaks the language’s grammar. The compiler catches it.
Compile-time error. Java also catches type errors before the program runs. For example, int passMark = "sixty"; tries to store text in an integer variable.
Run-time error. The code compiles, but trying to read scores[3] throws an exception when it runs. The three valid indices are 0, 1 and 2.
Computer Science Glossary
Data and values
| Term | Meaning | Example |
|---|---|---|
| Absolute value Noun | The distance from zero on the number line. | Math.abs(-7) returns 7. |
| Array Noun | In Java, a fixed-length collection of elements of the same declared type. | The array stores three exam scores. |
| Boolean Adj. | Having one of two values, true or false. | The comparison produces a Boolean value. |
| Element Noun | A component or part of a larger structure | This list has 12 elements |
| Index Noun | The position of an element in an ordered collection. | In Java, the first element of an array is at index 0. |
| Integer Noun | A number with no fractional part. | −3, 0 and 12 are integers. |
| String Noun | A sequence of characters | The variable stores a string value of “funky” |
| Variable Noun | A named location in memory that stores a value | The variable stores the result of a calculation |
Algorithms and loops
| Term | Meaning | Example |
|---|---|---|
| Algorithm Noun | A sequence of steps for solving a problem. | A sorting algorithm puts the scores in order. |
| Append Verb | To add something at the end of another | The program will append new data to the list |
| Increment Verb | To increase a value, often by one. | passed++ increments the count by one. |
| Iteration Noun | One pass through a loop. | Each iteration checks one score. |
| Recursion Noun | A technique in which a method calls itself, directly or indirectly, and stops at a base case. | A recursive method can work out a factorial. |
| Traversal Noun | Visiting and examining each item in a data structure | The traversal of the tree follows a specific order |
Methods and objects
| Term | Meaning | Example |
|---|---|---|
| Argument Noun | A value supplied in a call. | Pass 60 as the second argument. |
| Class Noun | A blueprint for creating objects | The student class has several methods |
| Constructor Noun | Code that initialises a new object. | The constructor sets the pupil’s name. |
| Method Noun | A named block of code defined in a class or interface in Java. | Call the method to count the passing scores. |
| Parameter Noun | A variable in a function definition | The function takes two parameters |
| Return Verb | To send back a result or value | The function will return the total sum |
Reading and debugging code
| Term | Meaning | Example |
|---|---|---|
| Compile Verb | To translate source code into another form, such as Java bytecode. | The program needs to be compiled before running |
| Scope Noun | The part of the code where a name can be used. | The loop variable score is in scope inside the loop body. |
| Statement Noun | An instruction in a program | The if statement checks a condition and executes code |
| Syntax Noun | The rules that define the structure of a programming language | The code contains a syntax error |
Related Articles:
- Computer Vocabulary
- In The News: Artificial Intelligence
- Learn English With Artificial Intelligence
- Speak Like A Tech Pro: Understanding Common Computer Idioms
- Workplace Idioms: Understanding The Language Of The Office
Frequently Asked Questions
The study of computers and computing, including programming, algorithms and how software and hardware work.
Technology words are used everywhere – at school, at work and in everyday life.
Test Yourself
Fancy a binary puzzle? Play LogicDash.
What is FunkyEnglish?
FunkyEnglish is a website that helps you improve your English. We offer quick lessons that teach idioms, slang, phrasal verbs and more. Visit our homepage to see our latest articles, or use the menu to find specific content!




