CS 18000 Lecture Notes - Lecture 7: Reserved Word, For Loop, Dynamic Array

45 views2 pages

Document Summary

Java class: includes fields attributes of an object and methods: operations on an object or the class. Fields and methods can be static or non-stati(cid:272): (cid:449)he(cid:374) stati(cid:272), the(cid:455) are (cid:862)of the (cid:272)lass,(cid:863) (cid:449)he(cid:374) (cid:374)o(cid:374)- static fields a(cid:374)d (cid:373)ethods are (cid:862)of the o(cid:271)je(cid:272)t(cid:863) Static field: one memory location shared by all objects of the class the same value shared by all methods. Non-static field: each instance of the class (object) has its own memory location for the field different value in each object. Instance variables: non-static fields in a class declaration. Class variables: static fields in a class declaration. Local variables: variables in a method or block. Method: a parameterized block of code that may return a value. Parameter: a variable local to a method that allows a method to work on different data values int calc(double x, int y(cid:895) { retur(cid:374) z;} //x and y are used for definition.

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