1620_lecture_9 - ITEC3620 Object-Based Programming Lecture...

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

View Full Document Right Arrow Icon
ITEC3620 Object-Based Programming Lecture 9 Programming with Objects
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Review Application Programmer Interfaces (APIs) list the available functionality of a class An API includes Constants, constructors, and methods Datatypes Argument lists with datatypes Descriptions of functionality
Background image of page 2
3 Keyboard Input Scanner class Provides functionality in Java to get user (keyboard) input Constructors Build new Scanner objects Methods Read data
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 Methods to Read Data int nextInt() Scans the next token of the input as an int. int datatype of result nextInt name (identifier) of method Not static!
Background image of page 4
static vs. non-static methods I static Same result for same parameters, every time “stateless” non-static Result depends on state 5
Background image of page 5

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

View Full DocumentRight Arrow Icon
static vs. non-static methods II nextInt() Should this method always return the same result? Which input source?
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 28

1620_lecture_9 - ITEC3620 Object-Based Programming Lecture...

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

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