Guess the output:
May seem straight forward to Java Geeks.
I thought this would give compile time error. Later on realized the output is
This is funny
Moral: It is possible for a method to have a declared return type and yet contain no return statements.
skip to main |
skip to sidebar
Thursday, June 11, 2009
Subscribe to:
Post Comments (Atom)
Search this blog
Blog Archive
About Me
- TechMaddy
- My job: 80% of my time, I suck data out of database, show it to the user, and let them change it. Again, the remaining 20% is Artistic. Eat low. Code smart. Cycle fast. Recycle past. I am: A Simple Abstraction of the complication within and I am extermely Polymorphic. My belief: I believe in action rather than words. My love: I love the nature, so add me or contact me for any green initiatives. I am a Simple Abstraction of the complication within and I am extermely Polymorphic. My belief: I believe in action rather than words.
Funny, interesting, cool.
ReplyDeleteBTW, do you know that you can instantiate an object in C++ in the following ways?
MyClass obj = new MyClass();
MyClass obj = new MyClass;
Now, tell me. What's the difference?
PS: The answer is here.
@Srikanth Thanks. I too didnt know that.
ReplyDelete