0% found this document useful (0 votes)
28 views1 page

This Study Resource Was

This Java class defines a Movie object with properties for title, year, and studio. It includes getter and setter methods for each property as well as a constructor to initialize the object and a toString method to return a formatted string of the property values.

Uploaded by

Marvin Torre
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views1 page

This Study Resource Was

This Java class defines a Movie object with properties for title, year, and studio. It includes getter and setter methods for each property as well as a constructor to initialize the object and a toString method to return a formatted string of the property values.

Uploaded by

Marvin Torre
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

/**

* Purpose:
*
* @author Hun Jin Choi
* @version 4/16/20
*
*/
public class Movie
{
// instance variables
private int year;
private String title;
private String studio;

// Constructor for objects of class Movie


public Movie(String title, int year, String studio)
{
// initialize instance variables
this.title = title;
this.year = year;
this.studio = studio;

m
}

er as
co
public String getTitle()

eH w
{
return title;

o.
} rs e
ou urc
public void setTitle(String title)
{
this.title = title;
}
o
aC s

public String getStudio()


v i y re

{
return studio;
}

public void setStudio(String studio)


ed d

{
ar stu

this.studio = studio;
}

public int getYear()


{
sh is

return year;
}
Th

public void setYear(int year)


{
this.year = year;
}

public String toString()


{
String str = String.format("%-30s %4d %-20s", title, year, studio);
return str;
}
}

This study source was downloaded by 100000808363706 from CourseHero.com on 04-20-2021 06:13:04 GMT -05:00

https://www.coursehero.com/file/62528039/Moviejava/
Powered by TCPDF (www.tcpdf.org)

You might also like