How do I make the code output Java? import java.util.Arrays;

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

How do I make the code output Java?

import java.util.Arrays;

public class Movie {
 
 String movieName;
 int numMinutes;
 boolean isKidFriendly;
 int numCastMembers;
 String castMembers[] = new String[10];
 
 // Non-parameterized constructor
 public Movie() {
  this.movieName = "Flick";
  this.numMinutes = 0;
  this.isKidFriendly = false;
  this.numCastMembers = 0;
 }
 
 // Parameterized constructor
 public Movie(String movieName, int numMinutes, boolean isKidFriendly, int numCastMembers, String[] castMembers) {
  this.movieName = movieName;
  this.numMinutes = numMinutes;
  this.isKidFriendly = isKidFriendly;
  this.numCastMembers = numCastMembers;
  this.castMembers = castMembers;
 }
 
 // getter and setters
 public String getMovieName() {
  return movieName;
 }

 public void setMovieName(String movieName) {
  this.movieName = movieName;
 }

 public int getNumMinutes() {
  return numMinutes;
 }

 public void setNumMinutes(int numMinutes) {
  this.numMinutes = numMinutes;
 }

 public boolean isKidFriendly() {
  return isKidFriendly;
 }

 public void setKidFriendly(boolean isKidFriendly) {
  this.isKidFriendly = isKidFriendly;
 }

 public int getNumCastMembers() {
  return numCastMembers;
 }

 public void setNumCastMembers(int numCastMembers) {
  this.numCastMembers = numCastMembers;
 }

 public String[] getCastMembers() {
  return castMembers;
 }

 public void setCastMembers(String[] castMembers) {
  this.castMembers = castMembers;
 }
 
 public String toString() {
  return "Movie name: "+movieName+"\n Num Minutes: "+numMinutes+"\nIs Kid Friendly: "+isKidFriendly+"\nNum cast memebers: "+numCastMembers+"\nCast Members: "+Arrays.toString(castMembers);
 }
 
 //Main funtion
 public static void main(String args[]) {
  
  //Printing default values
  System.out.println("-----------------------Default values------------------------");
  Movie m = new Movie();
  System.out.println(m);
  //printing setter new value
  String castMembers[] = {"Ram", "Charan", "Swami","Ganesh","Namita","Babita","Anunay","Shikhar","Dravin","peter"};
  Movie movie = new Movie("Avengers End game", 150, true, 25, castMembers);
  System.out.println("------------------------New setter values------------------");
  System.out.println(movie);
  
 }

}

Attribute
movieName numMinutes isKidFriendly
numCastMembers
castMembers
Default Value
"Flick"
false
length of 10
Transcribed Image Text:Attribute movieName numMinutes isKidFriendly numCastMembers castMembers Default Value "Flick" false length of 10
Data Type
String
int
boolean
int
String []
Variable Name movieName numMinutes isKidFriendly
numCastMembers castMembers
Transcribed Image Text:Data Type String int boolean int String [] Variable Name movieName numMinutes isKidFriendly numCastMembers castMembers
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Adjacency Matrix
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education