Java View all facts Glossary Help |
member > instance member > instance 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 | Methods | marking it abstract | any executable statements in its body | to serve as a placeholder, indicating that subclasses must have concrete implementations | public float credit(float amountToCredit) { | a method in a subclass | instance method | in a class that is not abstract | overriding methods in all non-abstract subclasses with instances that call that method | body | A method with no implementation | ||||
join | instance method | Threads | return statement unless it has a void return type | to direct a program to wait for a thread to finish its work | public float credit(float amountToCredit) { | 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 class | a comment at its head if the method is non-obvious | method signature | |||||
method that is declared in Object class | Methods | return statement unless it has a void return type | public float credit(float amountToCredit) { | instance method | its return type | a comment at its head if the method is non-obvious | method signature | ||||||||
sleep | instance method | Threads | return statement unless it has a void return type | to pause a thread for a specified time | public float credit(float amountToCredit) { | its return type | try{sleep(time in milliseconds);} | Thread class | a comment at its head if the method is non-obvious | method signature | |||||
synchronized instance method | Threads | return statement unless it has a void return type | Only one thread will be allowed inside this method at oncepublic synchronized void countMe() { | instance method | its return type | Java 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-obvious | method signature |
Next instance member: instance variable Up: instance member, method