MARKET 1 Lecture Notes - Lecture 6: Cartesian Coordinate System, Mathematical Notation, Substring

9 views8 pages
School
Department
Course
Professor

Document Summary

Definition: a collection of data that provides a set of methods, example: a string is a collection of characters that provides methods like charat and substring. Its purpose is to identify which variable you are referring to unambiguously: use the point object: import java. awt. point; Point blank; blank = new point(3, 4); //coordinates to the. Point blank; blank = new point(3, 4); int sum = blank. x + blank. y; System. out. println( the coordinates are blank. x + , + blank. y + . ); System. out. println( the sum of the coordinates is + sum + . ); The sum of the coordinates is 7: rectangle, a rectangle is similar to a point, but they have four attributes: x, y, width, and height, use the rectangle object: import java. awt. rectangle; //creates point named blank box = new rectangle(0, 0, 100, 200); Point objects provide a method called tostring that returns a string representation of a point.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents