Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using the attached Java classes (Arcade.java and Pinball.java) as a guide, create a representative JSON string that might be produced upon serialization of an Arcade

  1. Using the attached Java classes (Arcade.java and Pinball.java) as a guide, create a representative JSON string that might be produced upon serialization of an Arcade object. You are free to populate the Arcade and Pinball object properties with any data you like as long as it is not empty/blank and accurately represents the associated propertys data type (e.g., a numeric data type contains a number).

Arcade.java:

public class Arcade

{

private String name;

private Pinball[] machines;

private int establishmentYear;

public Arcade()

{

this.name = "";

this.establishmentYear = 1900;

this.machines = new Pinball[0];

}

public Arcade(String n, int e, Pinball[] m)

{

name = n;

establishmentYear = e;

machines = m;

}

//setters

public void setName(String name)

{

this.name = name;

}

public void setEstablishmentYear(int year)

{

this.establishmentYear = year;

}

public void setMachines(Pinball[] machines)

{

this.machines = machines;

}

//getters

public String getName()

{

return name;

}

public int getEstablishmentYear()

{

return establishmentYear;

}

public Pinball[] getMachines()

{

return machines;

}

}

Pinball.java:

public class Pinball

{

private String name;

private String manufacturer;

private int yearProduced;

public Pinball()

{

this.name = "";

this.manufacturer = "";

this.yearProduced = 1900;

}

public Pinball(String n, String m, int y)

{

name = n;

manufacturer = m;

yearProduced = y;

}

//setters

public void setName(String name)

{

this.name = name;

}

public void setManufacturer(String manufacturer)

{

this.manufacturer = manufacturer;

}

public void setYearProduced(int year)

{

this.yearProduced = year;

}

//getters

public String getName()

{

return name;

}

public String getManufacturer()

{

return manufacturer;

}

public int getYearProduced()

{

return yearProduced;

}

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Describe business models and discuss their importance.

Answered: 1 week ago

Question

1. What is meant by Latitudes? 2. What is cartography ?

Answered: 1 week ago