Вариант 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 {
double weight = 7.4;
protected String grassWater = "GrassWater";
static int glow;
public int juicer;
protected byte sky = (byte) 0x89;
protected String grass = "Grass";
protected String water = "Water";
public Pawniard() {
glow = 89;
juicer = 89;
}
static {
glow = 28;
}
public void batonPass() {
System.out.println(grassWater == grass+water);
System.out.println(grassWater == "Grass"+"Water");
System.out.println(grassWater.equals("Grass"+"Water"));
System.out.println(grassWater.equals(grass+water));
System.out.println(grassWater == "Grass"+water);
System.out.println(grassWater.equals(grass+"Water"));
}
public void lowKick(Pawniard p) {
System.out.println("Pawniard attacks Pawniard with Low Kick");
}
public void foresight() {
double evasion = 2.6;
System.out.println((weight - evasion) == 4.8);
}
public void lowKick(Bisharp p) {
System.out.println("Pawniard attacks Bisharp with Low Kick");
}
public void workUp() {
System.out.println(sky + glow);
System.out.println(glow - juicer);
System.out.println(juicer - sky);
}
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 iceWater = "IceWater";
private int threaded;
private String ice = "Ice";
double accuracy = 2.7;
{
threaded = 074;
}
public void conversion() {
System.out.println(iceWater == new String("Ice"+"Water"));
System.out.println(iceWater == ice+water);
System.out.println(iceWater == new String("IceWater"));
System.out.println(iceWater == (ice+water).intern());
}
public void lowKick(Bisharp p) {
System.out.println("Bisharp attacks Bisharp with Low Kick");
}
public void swordsDance() {
double speed = 8.8;
System.out.println((speed - accuracy) == 6.1);
}
public static void defiant() {
System.out.println("Bisharp casts Defiant");
}
public void unbreakable() {
System.out.println(threaded - glow);
System.out.println(threaded + juicer);
System.out.println(sky - threaded);
}
public void focusEnergy() {
System.out.println("Bisharp casts Focus Energy");
}
public void lowKick(Pawniard p) {
System.out.println("Bisharp attacks Pawniard with Low Kick");
}
}