class20 - 1 1 IST 240 Thu(3/27 ¢ Review Ch 5-8 Exam#2...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 1 IST 240 ¡ Thu (3/27) ¢ Review Ch 5-8 ¡ Exam #2: Ch 5-8 ¢ One sheet of notes, 8.5 x 11, both sides ¢ 20 questions, mostly short coding answers + ~5 short answer/multiple choice/T/F questions. ¢ Chapter 9: Polymorphism & Interfaces ¡ Jung-woo review: Mon (3/31) in IST 206, 6-7pm ¡ Tue (4/1) ¢ Exam #2: Ch 5-8 ¡ Thu (4/3) ¢ Ch 10: Exception Handling ¡ Tue (4/8) ¢ Teamwork day: Project implementation 2 Chapter 5: User-Defined Classes ¡ You should be able to ¢ Define a class, instance variables ¢ Write accessor, mutator methods for instance variables ¢ Write constructors ¡ understanding that you can overload them as long as they differ in number and type of parameters ¢ Know what the keyword this refers to ¢ Be able to write a toString method (that overrides methods inherited from Object class) ¡ NOT: creating packages, static variables and methods (although you might want to know this for your project) 2 3 Chapter 6: Graphical User Interfaces ¡ GUI panels inherit from: JPanel ¢ public class MainPanel extends JPanel ¡ How do we get the GUI to do something when a button is clicked? ¢ private class ButtonListener implements ActionListener ¡ This means that the methods in the ActionListener interface must be implemented, namely the actionPerformed method ¡ How do you write the code to make a new JLabel (or JButton) with the caption “Greetings”? ¢ JLabel myLabel = new JLabel(“Greetings”); ¡ Layout Managers: What do they do? You should be able to distinguish GridLayout, BorderLayout, FlowLayout. ¢ You don’t need to know the code needed to create one or how to add components to it. 4 Chapter 7: Arrays ¡ You should be able to ¢ Define an array of type t ¢ Instantiate array of size n ¡ In other words, create space for the array ¢ Know what length variable means/does ¢ Assign values to array elements ¢ Print array elements ¡ NOT: multi-dimensional arrays 3 5 Chapter 8 ¡ You should know ¢ Inheritance Æ how to use the keyword extends ¢ Inheritance taxonomy: subclass, superclass ¢ New accessor modifier: protected ¢ What instance variables and methods of a class can get inherited? ¢ Subclass constructors and how/why to call super() ¢ Interfaces Æ use keyword implements ¡ Like a contract, requires implementing class to implement all the methods Study questions to try at home 4 7 Chapter 5: Write a Student class ¡ Write the Student class with ¢ 2 instance variables: gpa (type double), canGraduate (type boolean). Make one private and one protected. ¢ 2 constructors: one with no parameters, one with 2 parameters for gpa and canGraduate. ¢ 2 accessor + 2 mutator methods ¢ toString method 8 Chapter 5: Write StudentClient class public class StudentClient { public static void main(String[ ] args) { ¡ Write the line of code that creates a Student using the constructor with no parameters ¡ Write the line of code that creates a Student using the constructor with 2 parameters ¡ Print out first student: System.out.println(student1);Print out first student: System....
View Full Document

{[ snackBarMessage ]}

Page1 / 15

class20 - 1 1 IST 240 Thu(3/27 ¢ Review Ch 5-8 Exam#2...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online