Advertisement
oona

super heroes

Apr 4th, 2014
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.81 KB | None | 0 0
  1. package oop;
  2.  
  3. class superHero
  4. {
  5.     String heroName;
  6.     String realName;
  7.     boolean human;
  8.     String powers;
  9.     String weakness;
  10.     int createdYear;
  11.     String nemesis;
  12.    
  13.     public void setHName(String heroName)
  14.     {
  15.         this.heroName = heroName;
  16.     }
  17.     public void setRName(String realName)
  18.     {
  19.         this.realName = realName;
  20.     }
  21.     public void setHuman(boolean human)
  22.     {
  23.         this.human = human;
  24.     }
  25.     public void setPowers(String powers)
  26.     {
  27.         this.powers = powers;
  28.     }
  29.     public void setWeakness(String weakness)
  30.     {
  31.         this.weakness = weakness;
  32.     }
  33.     public void setCYear(int createdYear)
  34.     {
  35.         this.createdYear = createdYear;
  36.     }
  37.     public void setNemesis(String nemesis)
  38.     {
  39.         this.nemesis = nemesis;
  40.     }
  41.     public String getHName()
  42.     {
  43.         return this.heroName;
  44.     }
  45.     public String getRName()
  46.     {
  47.         return this.realName;
  48.     }
  49.     public boolean getHuman()
  50.     {
  51.         return this.human;
  52.     }
  53.     public String getPowers()
  54.     {
  55.         return this.powers;
  56.     }
  57.     public String getWeakness()
  58.     {
  59.         return this.weakness;
  60.     }
  61.     public int getCYear()
  62.     {
  63.         return this.createdYear;
  64.     }
  65.     public String getNemesis()
  66.     {
  67.         return this.nemesis;
  68.     }  
  69. }
  70.  
  71. public class superHeroes {
  72.  
  73.     public static void main(String[] args) {
  74.         // TODO Auto-generated method stub
  75.        
  76.         superHero detail = new superHero();
  77.        
  78.         detail.setHName("Superman");
  79.         detail.setRName("Clark");
  80.         detail.setHuman(false);
  81.         detail.setPowers("Flying");
  82.         detail.setWeakness("Cryptonite");
  83.         detail.setCYear(1938);
  84.         detail.setNemesis("Brainiac");
  85.         System.out.println(detail.getHName());
  86.         System.out.println(detail.getRName());
  87.         System.out.println(detail.getHuman());
  88.         System.out.println(detail.getPowers());
  89.         System.out.println(detail.getWeakness());
  90.         System.out.println(detail.getCYear());
  91.         System.out.println(detail.getNemesis());
  92.        
  93.     } //main ends here
  94.  
  95. } //class ends here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement