Aerosim Flight Academy Code About Introduction of Java Generic Type T HW http://deanzacollegecis.jenniferparrish.net/home/c…link for activity15.1 http:/
Aerosim Flight Academy Code About Introduction of Java Generic Type T HW http://deanzacollegecis.jenniferparrish.net/home/c…link for activity15.1
http://deanzacollegecis.jenniferparrish.net/home/c…link for activity16.1&16.2
Answer the following review question from Lesson 15 by either typing directly into the textbox below or by uploading a document with your answers. Please include the question along with your answer to make your responses easy to read.
1.Rewrite the below class to make it store data of the generic type T:
public class Box {
private Candy contents1;
private Candy contents2;
private static int numBoxes = 0;
public Box() {
contents1 = null;
contents2 = null;
}
public Candy getContents1() {
return contents1;
}
public Candy getContents2() { return contents2;
}
public static int getNumBoxes() {
return numBoxes;
}
public void setContents1(Candy contents1) {
this.contents1 = contents1;
}
public void setContents2 (Candy contents2) {
this.contents2 = contents2;
}
public void updateNumBoxes() {
numBoxes++;
}
}
Answer the following review question from Lesson 16 by either typing directly into the textbox below or by uploading a document with your answers. Please include the question along with your answer to make your responses easy to read.
1. What will be the output of the below program if the user enters “two” for the numInParty?
import java.util.Scanner;
import java.util.InputMismatchException;
public class TestExceptions {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int numInParty = 0;
try {
System.out.print(“Welcome to Chez Yum Restaurant!”);
System.out.print(“Enter the number in your party: “);
numInParty = input.nextInt();
System.out.println(“We can seat ” + numInParty
+ ” people right away!”);
} catch(NullPointerException e) {
System.out.println( “Error! String is empty!”);
} catch(InputMismatchException e) {
System.out.println(“Please enter a number not text!”);
} finally {
System.out.println(“Thanks visiting Chez Yum!”);
}
}
}
I need activity 15.1 and answer about lesson 15 today within 5 hours.
And I will post lab 8 tomorrow. Lab 8 due at 6/6.
We've got everything to become your favourite writing service
Money back guarantee
Your money is safe. Even if we fail to satisfy your expectations, you can always request a refund and get your money back.
Confidentiality
We don’t share your private information with anyone. What happens on our website stays on our website.
Our service is legit
We provide you with a sample paper on the topic you need, and this kind of academic assistance is perfectly legitimate.
Get a plagiarism-free paper
We check every paper with our plagiarism-detection software, so you get a unique paper written for your particular purposes.
We can help with urgent tasks
Need a paper tomorrow? We can write it even while you’re sleeping. Place an order now and get your paper in 8 hours.
Pay a fair price
Our prices depend on urgency. If you want a cheap essay, place your order in advance. Our prices start from $11 per page.