Package org.example
Class Main
java.lang.Object
org.example.Main
The Main class demonstrates usage of the Clothing class:
- creating an array of objects
- sorting by different fields
- searching for an identical object
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Main method that runs the demonstration.private static void
sortByTypeAndBrand
(Clothing[] clothes) Sorts an array of Clothing objects: - first by type ascending (A→Z) - then by brand descending (Z→A) if types are equal
-
Constructor Details
-
Main
public Main()
-
-
Method Details
-
main
Main method that runs the demonstration.- Parameters:
args
- command-line arguments (not used in this demo)
-
sortByTypeAndBrand
Sorts an array of Clothing objects: - first by type ascending (A→Z) - then by brand descending (Z→A) if types are equal- Parameters:
clothes
- array of Clothing objects to sort
-