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

Java Movie Class Implementation

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)
6 views1 page

Java Movie Class Implementation

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

/**

* 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
[Link] = title;
[Link] = year;
[Link] = studio;

m
}

er as
co
public String getTitle()

eH w
{
return title;

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

public String getStudio()


v i y re

{
return studio;
}

public void setStudio(String studio)


ed d

{
ar stu

[Link] = studio;
}

public int getYear()


{
sh is

return year;
}
Th

public void setYear(int year)


{
[Link] = year;
}

public String toString()


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

This study source was downloaded by 100000808363706 from [Link] on 04-20-2021 06:13:04 GMT -05:00

[Link]
Powered by TCPDF ([Link])

You might also like