CS 2110 Lecture 2: Objects

27 views4 pages

Document Summary

Like in python, parameter is the variable inside a method. Argument is when you call the method. Value of this expression is a pointer to the new object. This lets us know the type for h. Now the object name is stored in h. Note: procedure is a method that does not return a value. To call methods from outside, you do h. () Note: you"re de(cid:272)laratio(cid:374) of (cid:455)our (cid:448)aria(cid:271)le (cid:272)a(cid:374) (cid:271)e (cid:373)ade shorter (cid:271)(cid:455) (cid:272)o(cid:373)(cid:271)i(cid:374)i(cid:374)g the two lines. Now we can combine the two int x = 5. So for class definitions, if we want to make something of class cc for example. Creates variable g, stores the object of type cc"s (cid:374)a(cid:373)e i(cid:374) g. If we do public class cc extends javax. swing. jframe {} We get c as a subclass of jframe. Write public int area() {} int is the type of value the function will return. Area is the name of the function.

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

Related Questions