×

Loading...
Ad by
  • 予人玫瑰,手有余香:加拿大新天地工作移民诚聘求职顾问&行业导师!
Ad by
  • 予人玫瑰,手有余香:加拿大新天地工作移民诚聘求职顾问&行业导师!

My answers. Please review and point out errors. :)

Java programmer's interview question: implement the framework of #6529843@0
Quote from mikesmith:

我告诉她,
你首先是个动物,先继承一个动物应有的品行:自爱,自立,躲避危险,尊重自然;
其次你是个人,诚信,善良,爱你周围的人和物;
再其次你是我和你妈妈的女儿:爱你这个家;
再再其次,你是加拿大人,爱你这个国家;
再再再其次:你是中国裔,爱你的传成。

顺序不可颠倒,真实最重要。

Java implementation:


abstract class Animal 
{
  protected Nature[] instincts = new Nature[] {
      new Nature("Love yourself"),
      new Nature("Be independent"),
      new Nature("Avoid dangers"),
      new Nature("Respect the mother nature")
    };
}

class Human extends Creature 
{
  protected Virtue virtues = new Virtue[] {
      new Virtue("Be honest"),
      new Virtue("Be kind"),
      new Virtue("Love others")
    };
}

interface Daughter 
{
  public void loveFamily();
  public void loveParents();
}

interface Canadian 
{
  public void loveCanada();
}

interface EthnicalChinese 
{
  public void carryChineseHeritage();
}

class CatDaughter extends Human implements Daughter, Canadian, EthnicalChinese
{
  Human dad = new Human("mikesmith");
  Human mom = new Human("mikesmith's tai tai");
}
Report

Replies, comments and Discussions:

  • 工作学习 / 学科技术讨论 / Java programmer's interview question: implement the framework of #6529843@0
    • My answers. Please review and point out errors. :)
      Java programmer's interview question: implement the framework of #6529843@0
      Quote from mikesmith:
      
      我告诉她,
      你首先是个动物,先继承一个动物应有的品行:自爱,自立,躲避危险,尊重自然;
      其次你是个人,诚信,善良,爱你周围的人和物;
      再其次你是我和你妈妈的女儿:爱你这个家;
      再再其次,你是加拿大人,爱你这个国家;
      再再再其次:你是中国裔,爱你的传成。
      
      顺序不可颠倒,真实最重要。
      
      Java implementation:
      
      
      abstract class Animal 
      {
        protected Nature[] instincts = new Nature[] {
            new Nature("Love yourself"),
            new Nature("Be independent"),
            new Nature("Avoid dangers"),
            new Nature("Respect the mother nature")
          };
      }
      
      class Human extends Creature 
      {
        protected Virtue virtues = new Virtue[] {
            new Virtue("Be honest"),
            new Virtue("Be kind"),
            new Virtue("Love others")
          };
      }
      
      interface Daughter 
      {
        public void loveFamily();
        public void loveParents();
      }
      
      interface Canadian 
      {
        public void loveCanada();
      }
      
      interface EthnicalChinese 
      {
        public void carryChineseHeritage();
      }
      
      class CatDaughter extends Human implements Daughter, Canadian, EthnicalChinese
      {
        Human dad = new Human("mikesmith");
        Human mom = new Human("mikesmith's tai tai");
      }
      
      • LOL!