27.   (Ragged array) Consider the following code: int[][] ra…

27.   (Ragged array) Consider the following code: int[][] ragged = {    {1, 2, 3},    {4, 5},    {6, 7, 8, 9}};System.out.println(ragged.length);System.out.println(ragged[0].length);System.out.println(ragged[1].length);System.out.println(ragged[2].length); a) What values are printed, one per line? b) Briefly explain why this is called a “ragged” (or jagged) array.

Define a Java interface Payable with a single method:double…

Define a Java interface Payable with a single method:double getPaymentAmount(); Then write a class Invoice that: ·         Implements Payable. ·         Has private fields: description (String), amount (double). ·         Has a constructor to set both fields. ·         Implements getPaymentAmount to return amount.

Suppose Person also has a no‑argument constructor that sets…

Suppose Person also has a no‑argument constructor that sets name = “Unknown”. Write a Student no‑arg constructor that:·         Calls the no‑arg superclass constructor.·         Sets gpa to 0.0. public class Person {    private String name;        public Person() {        this.name = “Unknown”;    }     public Person(String name) {        this.name = name;    }     public String getName() {        return name;    }}public class Student extends Person {    private double gpa;     public Student(String name, double gpa) {        super(name);        this.gpa = gpa;    }     public double getGpa() {        return gpa;    }}

Add a copy constructor to the Book class that takes another…

Add a copy constructor to the Book class that takes another Book object and creates a new Book with the same title and price.public class Book {    private String title;    private double price;     public Book() {        this.title = “Unknown”;        this.price = 0.0;    }     public Book(String title, double price) {        this.title = title;        this.price = price;    }     @Override    public String toString() {        return title + “: $” + price;    }}