S
Shawn
Dear All,
I have a Person class already. Now I have a String:
public class Person()
{
void sayHello()
{
System.out.println("Hello");
}
}
Person goodGuy = new Person();
String str = "goodGuy";
(Person)str.sayHello(); //Error: cannot cast from String to Person
This is desireable or I am just totally out of my mind?
I have a Person class already. Now I have a String:
public class Person()
{
void sayHello()
{
System.out.println("Hello");
}
}
Person goodGuy = new Person();
String str = "goodGuy";
(Person)str.sayHello(); //Error: cannot cast from String to Person
This is desireable or I am just totally out of my mind?