Do not worry about the last part of the assignment-the reading exercise part. The screenshots are a must. The directions on each assignment tells directly what needs to be done. I need an A on both assignments.
North Carolina A&T State University
ITT 240-01- Java
Fall – 2013
Assignment 5
· Due on Monday November 20th.
· Soft copy to be sent by e-mail or posted to Bb.
· Source file(s) is/are required
· Output screen snapshots also are required
· Word document explains the answers for each part.
· Please write your name and student ID at the top of the word document
EX 1:
Which of the following class definitions defines a legal abstract class?
EX 2:
Which of the following is a correct interface?
EX 3:
Show the printout of the following code:
java.util.Date date = new java.util.Date();
java.util.Date date1 = (java.util.Date)(date.clone());
System.out.println(date == date1);
System.out.println(date.equals(date1));
EX 4:
Are the following statements correct?
Integer i = new Integer(“23”);
Integer i = new Integer(23);
Integer i = Integer.valueOf(“23”);
Integer i = Integer.parseInt(“23”, 8);
Double d = new Double();
Double d = Double.valueOf(“23.45”);
int i = (Integer.valueOf(“23”)).intValue();
double d = (Double.valueOf(“23.4”)).doubleValue();
int i = (Double.valueOf(“23.4”)).intValue();
String s = (Double.valueOf(“23.4”)).toString();
EX 5:
What is wrong in the following code?
public class Test {
public static void main(String[] args) {
Number x = new Integer(3);
System.out.println(x.intValue());
System.out.println((Integer)x.compareTo(new Integer(4)));
}
}
Reading Exercise
Read chapter 10. Propose 6 – 12 keywords. Compose 2 – 3 sentences to describe each chapter in a concise, comprehensive, and unambiguous manner.
PAGE
Dr. Naser El-Bathy
Page 3
North Carolina A&T State University
ITT 240-01- Java
Fall – 2013
Assignment 6
· Due on Monday November 27th.
· Soft copy to be sent by e-mail or posted to Bb.
· Source file(s) is/are required
· Output screen snapshots also are required
· Word document explains the answers for each part.
· Please write your name and student ID at the top of the word document
EX 1:
What is the printout of running the class C in (a)? What problem arises in compiling the program in (b)?
EX 2:
Which of the following is a correct interface?
EX 3:
Identify the problems in the following classes:
EX 4:
Show the output of following program:
Reading Exercise
Read chapter 9. Propose 6 – 12 keywords. Compose 2 – 3 sentences to describe each chapter in a concise, comprehensive, and unambiguous manner.
PAGE
Dr. Naser El-Bathy
Page 3