☕ Java Patulong po sa java mga boss

Status
Not open for further replies.
Mga boss dko po alam pano mag store ng objects sa array bale subclasses po tos ioutput using loop.

Ganto po dapat output. Salamat in advance mga boss.
Screenshot_20220515_173144.webp


Ask lng po. Kelangan ba dito ng if-else para no Gore-Tex at Gore-Tex ung output??

Heto po ung mga codes:

//Main.java

package SubnSupr;


public class Main {
public static void main(String args[]) {
Running r = new Running(250, "Nike", 43);
Walking w1 = new Walking(true, "Hanwag", 43.5);
Walking w2 = new Walking(false, "Merrell", 42);


Shoe[] arr = {r, w1, w2};

}
}

// Superclass: Shoe.java

package SubnSupr;


public class Shoe {


public final String brand;
public final double size;


Shoe(String brand, double size) {
this.brand = brand;
this.size = size;
}
}

//Subclass: Walking.java

package SubnSupr;


public class Walking extends Shoe {


public final boolean goreTex;


Walking(boolean goreTex, String brand, double size) {
super(brand, size);
this.goreTex = goreTex;
}
}

//Sublcass Running.java

package SubnSupr;

public class Running extends Shoe{

public final double weight;

Running(double weight, String brand, double size) {
super(brand, size);
this.weight = weight;
}
}
 
sa fb ka humingi nang tulong sa mga groups malabo kasing may maka notice minsan nang thread na ganto tas kung meron man matatagalan.
 
Status
Not open for further replies.

About this Thread

  • 2
    Replies
  • 450
    Views
  • 1
    Participants
Last reply from:
Lucifer Mrnngstr

Online now

Members online
930
Guests online
911
Total visitors
1,841

Forum statistics

Threads
2,276,279
Posts
28,968,921
Members
1,231,199
Latest member
Hhhfhjjn
Back
Top