Subject |
refer to |
wait until |
have default implementation |
call by |
have |
is part of |
is a kind of |
is a subtopic of |
have example |
overuse |
have return type |
is an instance of |
have purpose |
access by |
have arguments |
has part |
have result |
mark as |
declare |
used in |
contain |
create by |
write for |
equals method | | | | | a comment at its head if the method is non-obvious | | | The Basics of Java | boolean b = aPostalCode.equals(anotherPostalCode); | | | Java method | to test whether two objects are equal i.e. they contain the same data, but are not necessarily the same object | other methods and variables in any class in the same package by default | | | | | | | | | |
Java abstract method | | | | | a comment at its head if the method is non-obvious | | Java method | The Basics of Java | | | | | to serve as a placeholder, indicating that subclasses must have concrete implementations | other methods and variables in any class in the same package by default | | | | | | | any executable statements in its body | labelling it with the keyword abstract | |
Java class method | | | | using the name of the class, followed by a dot, followed by the name of the method (the name of the class can be omitted when calling a class method in the current class) | 'this' value when it is executing | | Java method | The Basics of Java | | | | | implementing functions such as initializing a class, or operating on the complete set of instances of a class | other methods and variables in any class in the same package by default | | | | static | | | | | |
Java constructor | | | | | the same name as its class | a class | Java method | The Basics of Java | public Account(String accountHolder, float initialBalance) { this.accountHolder = accountHolder; balance = initialBalance; opened = new Date(); } public Account(String accountHolder) { this.accountHolder = accountHolder; balance =0.0; opened = new Date(); } | | | | to initialize the instance variables of a newly created object and perform any other needed initialization | other methods and variables in any class in the same package by default | | | | | | | | | |
Java instance method | the object itself using the 'this' keyword | | | | a comment at its head if the method is non-obvious | | Java method | The Basics of Java | public float credit(float amountToCredit) { balance = balance + amountToCredit; return balance; } | | void if it does not return anything | | | other methods and variables in any class in the same package by default | | return type | | | public, protected or private | | | | |
println | | | | | a comment at its head if the method is non-obvious | | | The Basics of Java | System.out.println("This line will be printed"); | | | Java method | | other methods and variables in any class in the same package by default | | | | | | | | | |
private method | | | | | a comment at its head if the method is non-obvious | | Java method | The Basics of Java | | | | | | code in the same class | | | | | | | | | |
protected method | | | | | a comment at its head if the method is non-obvious | | Java method | The Basics of Java | | | | | | code in the same package as this class as well as code in any subclasses, even if they are not in the same package | | | | | | | | | |
public method | | | | | a comment at its head if the method is non-obvious | | Java method | The Basics of Java | | | | | | any code anywhere | | | | | | | | | |
readObject | | an object is received over the socket, or until an I/O error occurs, which will happen if the program at the other end of the connection is terminated | | | a comment at its head if the method is non-obvious | | | 3.5 - Technology Needed to Build Client-Server Systems | | | | Java method | | other methods and variables in any class in the same package by default | | | | | | client-server systems | | | |
substring | | | | | a comment at its head if the method is non-obvious | | | The Basics of Java | String sub = "submariner".substring(0,3); // = "sub" | | | Java method | to extract part of a string | other methods and variables in any class in the same package by default | starting position and ending position + 1 | | a new String with a sequence of characters from the original string | | | | | | |
toString | | | the name of the class followed by a hexadecimal code that distinguishes one instance from another | | a comment at its head if the method is non-obvious | | | The Basics of Java | | | | Java method | to convert any kind of object into a string | other methods and variables in any class in the same package by default | | | | | | | | | every class you create |