1. Static methods cannot be overloaded.
2. Final defines constants and cannot be overloaded or changed.
3. Transient defines non-serializable variables, which can only reside in the memory without the need for hard disk storage or network transmission.
4. Volatile indicates the variables that can be operated asynchronously. It is mostly used for multithreading.
5. Finalize sends a garbage collection request. The JVM implements garbage collection based on the situation. It is not recommended to display the call.
6. This indicates the current object, which is mainly used to differentiate variable calls and call Constructor (the first statement that can create another function, in other words
, Can only be called once); Super is for the parent class this.
Code:
Class testthis
{
Testthis ()
{
System. Out. println ("testthis ()");
// This ("Haha ");
// This ("Heihei ");
}
Testthis (string text)
{
This ();
System. Out. println ("textthis (string text)" + text );
}
Public void Prin ()
{
// This ();
// This ("Prin ");
System. Out. println ("Prin ()");
}
Public static void main (string [] ARGs)
{
Testthis testthisobj1 = new testthis ();
Testthis testthisobj2 = new testthis ("testthisobj2 ");
Testthisobj1.prin ();
Testthisobj1.finalize ();
Testthisobj1.finalize ("Hoho ");
Testthisobj1.finalize ();
Testthisobj1.finalize ("Hoho ");
Testthisobj1.prin ();
}
Protected void finalize ()
{
System. Out. println ("Haha ");
}
Protected void finalize (string Str)
{
System. Out. println ("string Str" + Str );
}
}