'F' → Fullscreen
Implement getters and setters for the Movie class.
class Movie{ private String title; private String director;
public Movie() { title = "Untitled"; director = "Unknown"; }
public Movie(String title, String director) { this.title = title; this.director = director; }
public String getTitle() { return title; }
public String getDirector() { return director; }
public void setTitle(String title) { this.title = title; }
public void setDirector(String director) { this.director = director; }}public class Program{ public static void main(String[] args) { Movie m = new Movie("Inception", "Christopher Nolan");
System.out.println(m.getTitle()); System.out.println(m.getDirector());
m.setTitle("Interstellar"); System.out.println(m.getTitle()); }}Modify this BankAccount class to enforce correct behavior through encapsulation.
class BankAccount{ private String owner; private double balance;
public BankAccount(String owner, double balance) { this.owner = owner;
// Validate initial balance if (balance < 0) { this.balance = 0; } else { this.balance = balance; } }
public String getOwner() { return owner; }
public double getBalance() { return balance; }
// Controlled deposit public void deposit(double amount) { if (amount > 0) { balance += amount; } }
// Controlled withdrawal public void withdraw(double amount) { if (amount > 0 && amount <= balance) { balance -= amount; } }}public class Program{ public static void main(String[] args) { // Movie test code ommitted.
BankAccount acct = new BankAccount("Alex", 100);
acct.deposit(50); acct.withdraw(30);
System.out.println(acct.getOwner() + " - Balance: $" + acct.getBalance()); }}InceptionChristopher NolanInterstellar
Alex - Balance: $120.0Write your answers as comments in your Program.java file.
Submit your completed class files and reflection answers to the appropriate dropbox.