- Joined
- Feb 13, 2009
- Messages
- 1
- Reaction score
- 0
When you create a method that compares two objects and it's arguments are of a type of another class, do you have to do some sort of casting if you get a incompatible type error? Is it even possible to cast a String into a another class or vice versa. Heres the code I have so far
Code:
class Object{
String Object;
}
Code:
public class Equals {
public static Object object(Object zero1, Object zero2) {
zero1 = "hello";
zero2 = str1;
System.out.println("Same object? " + (zero1 == zero2));
}
}