public class RadioStationDemo { public static void main(String[] args) { // Создаем…
- User
public class RadioStationDemo { public static void main(String[] args) { // Создаем объекты Genre genreVideo = new Genre("MACAN - TSM", "Rap", 3, 199.99, true, 'M', 1234567L, (short) 30, (byte) 2); Bid bid = new Bid("FRIENDLY THUG 52 NGG - AMMO", "Underground rap", "Street racing", 299.99, false, 'B', 7654321L, (short) 20, (byte) 3);
codeSystem.out.println("Video Name: " + genreVideo.getName()); System.out.println("Genre: " + genreVideo.getGenre()); System.out.println("Time: " + genreVideo.getTime() + " min"); System.out.println("Price: " + genreVideo.getPrice()); System.out.println("Available: " + genreVideo.isAvailable()); System.out.println("View Count: " + genreVideo.getViewCount()); System.out.println("Rating: " + genreVideo.getRating()); System.out.println("Level: " + genreVideo.getLevel()); System.out.println("Bid Name: " + bid.getBidName()); System.out.println("Bid Video Name: " + bid.getName()); System.out.println("Bid Genre: " + bid.getGenre()); System.out.println("Bid Price: " + bid.getPrice()); System.out.println("Bid Available: " + bid.isAvailable()); System.out.println("Bid View Count: " + bid.getViewCount()); System.out.println("Bid Rating: " + bid.getRating()); System.out.println("Bid Level: " + bid.getLevel()); // Изменяем значения genreVideo.setTime(2); bid.setBidName("Overnight in St. Petersburg"); System.out.println("Updated Genre Time: " + genreVideo.getTime() + " min"); System.out.println("Updated Bid Name: " + bid.getBidName()); }} class Video { private String name; private String genre; private double price; private boolean available; private long viewCount; private short rating; private byte level;
code - Assistant
- User
Video Name: MACAN - TSM Genre: Rap Time: 3 min Price: 199.99 Available: true View Count: 1234567 Rating: 30 Level: 2 Bid Name: Street racing Bid Video Name: FRIENDLY THUG 52 NGG - AMMO Bid Genre: Underground rap Bid Price: 299.99 Bid Available: false Bid View Count: 7654321 Bid Rating: 20 Bid Level: 3 Updated Genre Time: 2 min Updated Bid Name: Overnight in St. Petersburg
- Assistant
The output you've shared is what you would expect when running the corrected Java code. Here's a breakdown of what's happening:
-
Creating Objects:
- A
Genreobject namedgenreVideois created with specific attributes like name, genre, time, price, availability, etc. - A
Bidobject namedbidis also created with its own set of attributes.
- A
-
Printing Initial Values:
- When you print the attributes of the
genreVideoobject, you're displaying details like the name ("MACAN - TSM"), genre ("Rap"), time (3 min), price (199.99), availability (true), view count (1,234,567), rating (30), and level (2).
- When you print the attributes of the
-
- User
убери из кода цену, доступность и уровень
- Assistant
- User
В этот код нужно добавить Методы equals & hashCode
- Assistant
- User
добавь в код поля всех типов
- Assistant