Java   View all facts   Glossary   Help
member > instance member > instance method
Next instance memberinstance variable    Upinstance member, method

instance method comparison table
Subject is an instance of is a subtopic of create by contain have purpose have example override by is a kind of define run until have syntax be a member of have have part has definition
abstract method Methodsmarking it abstractany executable statements in its bodyto serve as a placeholder, indicating that subclasses must have concrete implementations
public float credit(float amountToCredit) {
balance = balance + amountToCredit;
return balance;
}
a method in a subclassinstance methodin a class that is not abstract   overriding methods in all non-abstract subclasses with instances that call that methodbodyA method with no implementation
joininstance methodThreads return statement unless it has a void return typeto direct a program to wait for a thread to finish its work
public float credit(float amountToCredit) {
balance = balance + amountToCredit;
return balance;
}
  its return type 
thread.join(0)
The argument specifies the time in milliseconds the program is to wait. 0 means the program will wait as long as necessary
Thread classa comment at its head if the method is non-obviousmethod signature 
method that is declared in Object class Methods return statement unless it has a void return type 
public float credit(float amountToCredit) {
balance = balance + amountToCredit;
return balance;
}
 instance methodits return type   a comment at its head if the method is non-obviousmethod signature 
sleepinstance methodThreads return statement unless it has a void return typeto pause a thread for a specified time
public float credit(float amountToCredit) {
balance = balance + amountToCredit;
return balance;
}
  its return type 
try{sleep(time in milliseconds);}
catch (InterruptedException e) {return;}
Thread classa comment at its head if the method is non-obviousmethod signature 
synchronized instance method Threads return statement unless it has a void return type Only one thread will be allowed inside this method at once
public synchronized void countMe() {
crucialValue += 1;
}
 instance methodits return typeJava obtains a lock on the instance that invoked the method, ensuring that no other thread can be modifying the object at the same time  a comment at its head if the method is non-obviousmethod signature 

Next instance memberinstance variable    Upinstance member, method