Hi everyone,
I ran across something today at work that I haven't seen before ( still new to
Java ) and when I Google for examples or tutorials I'm not finding anything.
A method where the return type is ClassName.StaticClass? In the example below Api is the class and Builder is the static class.
The static class method has a variable name "messageType" with type class MessageType.
If you can help, I have two questions please.
1) Since I know if that if the return type of a method is
String or int for example then the return type would be a String or an int so I assume the return type of the setMessageType method is what is in the static class Builder?
2) Would the setMessageType method's parameter of MessageType, only use the MessageType class which the static class is using?
What I am trying to say is there are two classes named "MessageType" which I have the option to use. The class Api is contained in a jar file that I had to import into my project. The project already has a class named MessageType and the jar file has a class name MessageType.
I tried to pass the setMessageType method a MessageType argument using the class that was in my project instead of what was in the jar file and it wouldn't accept it. So I assume it's because of the return type.
Thank You!