Вариант 516 public class Lab2 public static void main String args Pawn

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
// Вариант 516
public class Lab2 {
public static void main(String[] args) {
Pawniard father = new Pawniard();
Bisharp son = new Bisharp();
Pawniard sister = new Bisharp();
sister.batonPass();
son.lowKick(sister);
son.focusEnergy();
father.foresight();
sister.defiant();
father.lowKick(sister);
sister.focusEnergy();
father.focusEnergy();
son.defiant();
father.lowKick(son);
((Bisharp)sister).conversion();
son.unbreakable();
son.workUp();
son.lowKick(father);
father.defiant();
son.swordsDance();
}
}
class Pawniard {
float weight = 8.2f;
protected String flyingRock = "FlyingRock";
static int weeble;
public int blender;
protected byte juicer = (byte) 0x89;
protected String flying = "Flying";
protected String rock = "Rock";
public Pawniard() {
weeble = 89;
blender = 89;
}
static {
weeble = 28;
}
public void batonPass() {
System.out.println(flyingRock == flying+rock);
System.out.println(flyingRock == "Flying"+"Rock");
System.out.println(flyingRock.equals("Flying"+"Rock"));
System.out.println(flyingRock.equals(flying+rock));
System.out.println(flyingRock == "Flying"+rock);
System.out.println(flyingRock.equals(flying+"Rock"));
}
public void lowKick(Pawniard p) {
System.out.println("Pawniard attacks Pawniard with Low Kick");
}
public void foresight() {
float length = 6.0f;
System.out.println((weight - length) == 2.2f);
}
public void lowKick(Bisharp p) {
System.out.println("Pawniard attacks Bisharp with Low Kick");
}
public void workUp() {
System.out.println(juicer + weeble);
System.out.println(weeble - blender);
System.out.println(blender - juicer);
}
public void focusEnergy() {
System.out.println("Pawniard casts Focus Energy");
}
public static void defiant() {
System.out.println("Pawniard casts Defiant");
}
}
class Bisharp extends Pawniard {
private String poisonRock = "PoisonRock";
private int underwater;
private String poison = "Poison";
float attack = 4.0f;
{
underwater = 074;
}
public void conversion() {
System.out.println(poisonRock == new String("Poison"+"Rock"));
System.out.println(poisonRock == poison+rock);
System.out.println(poisonRock == new String("PoisonRock"));
System.out.println(poisonRock == (poison+rock).intern());
}
public void lowKick(Bisharp p) {
System.out.println("Bisharp attacks Bisharp with Low Kick");
}
public void swordsDance() {
float evasion = 7.7f;
System.out.println((evasion - attack) == 3.7f);
}
public static void defiant() {
System.out.println("Bisharp casts Defiant");
}
public void unbreakable() {
System.out.println(underwater - weeble);
System.out.println(underwater + blender);
System.out.println(juicer - underwater);
}
public void focusEnergy() {
System.out.println("Bisharp casts Focus Energy");
}
public void lowKick(Pawniard p) {
System.out.println("Bisharp attacks Pawniard with Low Kick");
}
}