My question for Mindy is this: What will the following Java code print when compiled and run? Code: class Base{ void methodA(){ System.out.println("base - MethodA"); } } class Sub extends Base{ public void methodA(){ System.out.println("sub - MethodA"); } public void methodB(){ System.out.println("sub - MethodB"); } public static void main(String args[]){ Base b=new Sub(); //1 b.methodA(); //2 b.methodB(); //3 } }
Hmm Some sort of error message would be my guess...are you asking me to work it out for you??? Your club name is Slow
Mindy Fail. It was a trick question as the code won't compile. The compiler uses the class of the reference type rather than the object type to resolve method calls. Since the Base class doesn't have a methodB(), the compilation will fail. Looks like you're the slow one.
Pffft, Java C++ was the ****in dogs bollocks. All the power you ever needed and all the rope to hang yerself with you could ever wish for. Programming was dangerous as **** back in them days. We were the devil-may-care bad boys who got all the wimmin.
Dear Mindy Do you realise that the fan club is a fan of your many many fails (and the meltdown) ... not of you but as to how many times one person can **** up on a daily basis. This thread has delivered yet another MindyFail * * I'm might start using this with my team members at appraisal time: A: I wasn't able to achive my annual retention target! Me: Ah, I see ... in that case, we'll mark that objective as a MindyFail.
Mindy Fail. please log in to view this image The question was, what will be printed when the code is compiled and run. How can you run it if it won't compile?
Hooking all the spazmos like a master fisherman, well done MTS Anyway, do you have a favourite stadium disaster?
Hi Pud As honorary club chairman it is your task to compile a list of all these Fails and Meltdowns. You'll have to be brave and do it yourself...no diving for cover like on Friday Your club name is No Diving