My other sites |
New Summer Look :)
|
java.lang.Object |
java.lang.Math |
|
![]() |
|
|
- Objects of the class Object are the root of the class hierarchy
public class Object {
// Constructor
public Object();
public final Class getClass();
public int hashCode();
public boolean equals(Object obj);
protected Object clone();
public String toString();
protected void finalize();
// Thread methods,
public final void notify()
public final void notifyAll()
public final void wait(long)
}
- getClass() returns the object of type Class that represents the
untime |
public final class Class extends Object implements Serializable {
public static Class forName(String)
public Object newInstance()
public boolean isInstance(Object)
...
}
|
|
| - Instances represent classes and interfaces in a running
application - Created automatically by the VM or by a call to the classloader - No public constructor - Needed for writing systems that use reflection - forName returns the class object associated with the class with the given string name |
![]() |
- Character strings - all string literals ("abc") - Constant Methods for: - examining individual characters - comparing strings - searching strings - extracting substrings - copying - concatenating - translation to uppercase or lowercase |
| A string buffer implements a mutable sequence of characters
methods : append() and insert() The binary concatenation operator + x = "a" + 4 + "c" equals x = newStringBuffer().append("a"). append(4).append("c").toString(); How does this affect the passing by reference of Strings? |
|
- Needed for using datatypes on arrays of Objects, Lists etc.
|
| - Basic numerical operations - exponentials - logarithms - square roots - trigonometrics -Equivalent to C's <math.h> |
Examples:
abs pow, sqrt log, exp sin, cos, tan, asin, acos, atan floor, ceil, round max, min, random |
|
- There is a single instance of Runtime - It allows the application to interface with its environment - The current Runtime can be obtained from the static getRuntime() method - An application cannot create its own instance of this class - The most used methods: exec, exit, load |
|
- The Runtime exec methods return a Process object public abstract int waitFor() |
|
A number of useful class fields and methods void arraycopy(Object,
int, Object, int, int) |