1. Log in now to remove adverts - no adverts at all to registered members!

T.m.f.f.c.

Discussion in 'General Chat' started by Mind The Duck, Feb 20, 2013.

  1. Mind The Duck

    Mind The Duck Well-Known Member

    Joined:
    Jun 29, 2011
    Messages:
    34,070
    Likes Received:
    12,888
    No
     
    #21
  2. Whole-lot-of-Holt_HtH

    Joined:
    Jan 24, 2011
    Messages:
    3,411
    Likes Received:
    6
  3. Mind The Duck

    Mind The Duck Well-Known Member

    Joined:
    Jun 29, 2011
    Messages:
    34,070
    Likes Received:
    12,888
    Sorry, no, final answer
     
    #23
  4. Otto Flayshow

    Otto Flayshow Well-Known Member

    Joined:
    Jan 31, 2011
    Messages:
    14,150
    Likes Received:
    3,751
    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
       }
    }
    
     
    #24
  5. Mind The Duck

    Mind The Duck Well-Known Member

    Joined:
    Jun 29, 2011
    Messages:
    34,070
    Likes Received:
    12,888
    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
     
    #25
  6. Otto Flayshow

    Otto Flayshow Well-Known Member

    Joined:
    Jan 31, 2011
    Messages:
    14,150
    Likes Received:
    3,751
    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.
     
    #26
  7. Whole-lot-of-Holt_HtH

    Joined:
    Jan 24, 2011
    Messages:
    3,411
    Likes Received:
    6
  8. Mind The Duck

    Mind The Duck Well-Known Member

    Joined:
    Jun 29, 2011
    Messages:
    34,070
    Likes Received:
    12,888
    As I said. An error. Keep up, Slow
     
    #28
  9. Mind The Duck

    Mind The Duck Well-Known Member

    Joined:
    Jun 29, 2011
    Messages:
    34,070
    Likes Received:
    12,888
    I know
     
    #29
  10. Gambol

    Gambol George Clooney's wee brother

    Joined:
    Jan 22, 2010
    Messages:
    59,960
    Likes Received:
    17,493
    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.
     
    #30

  11. Null

    Null Well-Known Member
    Forum Moderator

    Joined:
    Jan 21, 2010
    Messages:
    34,186
    Likes Received:
    9,757
    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.
     
    #31
  12. Otto Flayshow

    Otto Flayshow Well-Known Member

    Joined:
    Jan 31, 2011
    Messages:
    14,150
    Likes Received:
    3,751
    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?
     
    #32
  13. Tina.

    Tina. Well-Known Member

    Joined:
    Nov 29, 2011
    Messages:
    18,241
    Likes Received:
    8,399
    Hooking all the spazmos like a master fisherman, well done MTS <applause>

    Anyway, do you have a favourite stadium disaster?
     
    #33
  14. Null

    Null Well-Known Member
    Forum Moderator

    Joined:
    Jan 21, 2010
    Messages:
    34,186
    Likes Received:
    9,757
    Careful now ... this may be seen as harrasment!
     
    #34
  15. As We Know

    As We Know 1 of the top judges in Europe

    Joined:
    Jun 12, 2012
    Messages:
    40,133
    Likes Received:
    54,715
    .
     
    #35
    Last edited: Nov 2, 2021
  16. ManDingo 20"/20"

    ManDingo 20"/20" MDMA Guru

    Joined:
    Oct 24, 2011
    Messages:
    15,330
    Likes Received:
    1,106
    mindys ****ing seething after I invited him to the group <laugh>
     
    #36
  17. Mind The Duck

    Mind The Duck Well-Known Member

    Joined:
    Jun 29, 2011
    Messages:
    34,070
    Likes Received:
    12,888
    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
     
    #37
  18. Mind The Duck

    Mind The Duck Well-Known Member

    Joined:
    Jun 29, 2011
    Messages:
    34,070
    Likes Received:
    12,888
    You forgot to carry the 1
     
    #38
  19. Mind The Duck

    Mind The Duck Well-Known Member

    Joined:
    Jun 29, 2011
    Messages:
    34,070
    Likes Received:
    12,888
    The one with the best special effects
     
    #39
  20. Deleted 1

    Deleted 1 Well-Known Member
    Forum Moderator

    Joined:
    Jun 16, 2011
    Messages:
    19,645
    Likes Received:
    3,736
    <laugh>.
     
    #40

Share This Page