Final answer:
The ShirtDemo application is a program that demonstrates the use of a Shirt class to declare and display multiple instances of Shirt objects.
Step-by-step explanation:
The student's question pertains to writing a Java application, specifically, the creation of a program called ShirtDemo. This program should include a Shirt class with auto-implemented properties such as Material, Color, and Size, all of string type. Additionally, a display method is needed to output the properties of the Shirt objects. Here is an example of how one might define the Shirt class and the display method:
public class Shirt {
public String Material { get; set; }
public String Color { get; set; }
public String Size { get; set; }
}
public class ShirtDemo {
public static void display(Shirt... shirts) {
for(Shirt shirt : shirts) {
System.out.println("Shirt Material: " + shirt.Material);
System.out.println("Shirt Color: " + shirt.Color);
System.out.println("Shirt Size: " + shirt.Size);
}
}
public static void main(String[] args) {
// Declare Shirt objects
// Call display method with different number of Shirt objects
}
}
The display method can accept a variable number of Shirt objects, thanks to the use of varargs in Java. After declaring Shirt objects in the main method, the display method can be called multiple times with different numbers of shirts.