Re: Casting with Object Refs
Posted By:
Anjan_Bacchu
Posted On:
Tuesday, February 3, 2004 10:00 PM
Hi There,
casting is required only for strongly typed languages like Java. They are not required for say, something like javascript, python, perl, etc.
You can download an excellent book at
http://64.78.49.204/ which will give detailed explanations on how casting is needed.
void bar() {
Object a = new String();
foo(A);
.
.
.
}
void foo(Object a){
String b = (String) a; // Example of casting an Object to String
.
.
.
}