Interface Classes

Satisfactory Essays
Outline

COMP 102 26/27:2

Designing with Interfaces
#26/#27 COMP 102 #26/#27 2012

• • • • •

Assig 9 Doing without the UI class Multiple types Interface classes Implementing Interface classes.

Peter Andreae
Computer Science Victoria University of Wellington

Reading: Reading
• Textbook • 7.6: 2D arrays • 9.3: Interfaces (note, textbook also discusses inheritance)

Copyright: Peter Andreae, Victoria University of Wellington
© Peter Andreae

ImageProcessor
• Fade
180 255 60 0

COMP 102 26/27:3

Assignment 9: Motel Booker
• • • •
0 1 2 3 4 5 6 7 8

COMP 102 26/27:4

• 2D Array of Bookings (each Booking has name and phone) display, add, delete. load from and save to file find free space
Mon Tue Wed Thu Fri Sat Sun

255 30

© Peter Andreae

© Peter Andreae

Types again
• Only values of the specified type can be put into a place

COMP 102 26/27:9

Object types
• All object values have two types:
• the type they were created as • the Object type

COMP 102 26/27:10

Variables, fields, array elements are all defined with a type What types are there
• primitive types: int, double, boolean, long, float, char, .. note: java will "coerce" some types into other types: double number = 4; • Object types: Every class • Arrays : int[ ], double[ ][ ], Balloon[ ], defines a type • Predefined: String, Color, File, Scanner, … • Programmer defined: CartoonFigure, Balloon, BalloonGame, … • Type of object determined at its creation: • new Balloon(100, 300) ⇒ a Balloon object • new File ("data.txt") ⇒ a File object • new int[100][100] ⇒ an array of arrays of int. • "Hello" ⇒ a String

• You can have a place of type Object:
Object value = new Balloon(100, 100); value = "not any more";

There are limits on what you can do with a place of type Object: value.pop(); value.toUpperCase();
Won't work if value contains a String Won't work if value contains a Balloon

You can only call methods on the value in a variable/field if the

You May Also Find These Documents Helpful

  • Satisfactory Essays

    User Interface

    • 1122 Words
    • 5 Pages

    • Understand several fundamental user interface (UI) design principles. • Understand the process of UI design. • Understand how to design the UI structure. • Understand how to design the UI standards. • Understand commonly used principles and techniques for navigation design. • Understand commonly used principles and techniques for input design. • Understand commonly used principles and techniques for output design. • Be able to design a user interface. • Understand the affect of nonfunctional…

    • 1122 Words
    • 5 Pages
    Satisfactory Essays
  • Better Essays

    User Interfaces

    • 1115 Words
    • 5 Pages

    analyze the importance of interface design and how much interface presents in our everyday life. The most of our daily tasks is accomplished with a use of at least one type of interface. The basic purpose of an interface is to help use to communicate with a machine. The three most common kinds of an interface are: touch sensitive interface, menu interface and graphical user interface. Using smart phones, laptops, going to the ATM machine is considered as using interface. Even writing this case study…

    • 1115 Words
    • 5 Pages
    Better Essays
  • Good Essays

    User Interfaces

    • 826 Words
    • 4 Pages

    Menu Interface This type of interface lets you interact with a computer or device by working your way through a series of screens or menus. Think about your iPod or mobile phone, they both use a menu driven interface. You are presented with a menu, you make a choice and then the next menu appears on the screen. You make another choice and so on. Menu driven interfaces can also be verbal rather than visual. Have you ever made a telephone call and been asked to 'press 1 for abc, press 2 for def…

    • 826 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    User Interfaces

    • 422 Words
    • 2 Pages

    User Interfaces Name: Ahmed Baha Class: 9B subject C Subject: ICT Command line user interfaces Command line interface is a user interface to a computer's operating system or an application in which the user responds to a visual prompt by typing in a command on a specified line, receives a response back from the system, and then enters another command, and so forth. A Command Line Interface allows the user to interact directly with the computer system by typing in commands (instructions)…

    • 422 Words
    • 2 Pages
    Satisfactory Essays
  • Better Essays

    Brain Computer Interface

    • 2281 Words
    • 10 Pages

    of science fiction. 2. Brain Machine Interface (Brain Computer Interface): In this definition, the word “brain” means the brain or nervous system of an organic life form rather than the mind. “Computer” means any processing or computational device, from simple circuits to silicon chips (including hypothetical future technologies such as quantum computing). A Brain Machine Interface (BMI), sometimes called a Direct Neural Interface or a Brain Computer Interface, is a direct communication pathway between…

    • 2281 Words
    • 10 Pages
    Better Essays
  • Satisfactory Essays

    Abstract Classes

    • 546 Words
    • 3 Pages

    IT111P WEEK 7-1 ABSTRACT CLASSES ABSTRACT  Before anything, take a look at the code below ABSTRACT  How do we use them? ABSTRACT Abstract classes CANNOT be instantiated.  So what are they good for?  How can you use them?  You might say that abstract classes are meant to be inherited  It contains abstract methods  Abstract methods are methods with no definition  If abstract methods have no definition, how can you use them?  ABSTRACT The derived class implements the abstract method’s…

    • 546 Words
    • 3 Pages
    Satisfactory Essays
  • Best Essays

    Human Machine Interface

    • 4965 Words
    • 20 Pages

    Current Technologies, Research direction and design of Safety and Impact for Human-Machine Interface Chan Wei-How UTAR Complex, Jalan Genting Kelang, 53300 Setapak, Kuala Lumpur. ronaldcwh@1utar.my Abstract In this paper, I am going to discuss about the current trend of technologies used and the research direction, as well as the design safety and impact for the Human-Machine Interface (HMI) on 4 different topics which are touch based, optic based, acoustic based technology and…

    • 4965 Words
    • 20 Pages
    Best Essays
  • Good Essays

    Elizabeth Hedrick (enhcp9) INTERFACE IST358FS2013 Microsoft Outlook 2010 is an effective and helpful personal the personal information manager. It is commonly used to help organize work and connect for personal. Outlook is very versatile and can be installed on a work PC, a home PC, and on a smart phone. It functions as an email which can stand-alone but also works with Microsoft Exchange Server. This provides access to other helpful features. Outlook is a simple program that is easy…

    • 546 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Derived Classes and Base Classes Mario Padilla IT/218 September 2, 2011 University of Phoenix/Axia College Derived Classes and Base Classes Considering that the ostrich is a flightless bird, it is reasonable to derive a class CHawk from CBird, but not a COstrich. This is mainly because the function fly () sets an altitude of 100 and, as everyone knows, the ostrich cannot fly. If we had to derive COstrich from CBird probably need to provide a function fly () to return 0, and this could…

    • 290 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Interface and Processing Required It’s with S.O.G.S. best interest and desires to keep the users navigation and layout webite to being as simple and user friendly as possible. When selecting the navigation system future scalability is take into consideration to conform to standard website practices. S.O.G.S. will be designed with a tiered menu system and use many top tier wordings Home, Admissions, Academic, Form, RSS, and FAQ’s. As well as additional top tier will be include with the categories…

    • 491 Words
    • 2 Pages
    Good Essays