☕ 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
  • 452
    Views
  • 1
    Participants
Last reply from:
Lucifer Mrnngstr

Trending Topics

Online now

Members online
826
Guests online
1,717
Total visitors
2,543

Forum statistics

Threads
2,293,602
Posts
29,085,088
Members
1,207,903
Latest member
yourz1013
Back
Top