COMP 202 Lecture Notes - Lecture 21: Programming Paradigm

11 views7 pages
jc123 and 40170 others unlocked
COMP 202 Full Course Notes
100
COMP 202 Full Course Notes
Verified Note
100 documents

Document Summary

There are 850 students in the class. int numstudents = 850. String[] firstnames = new string[numstudents]; everyone has a first name. Everyone has a last name. long [] ids = new long[numstudents]; Everyone has an email. double[] gpa = new double[numstudents]; We need to make all these arrays to make a list of all these students. Not great because: (1) this is a lot of arrays. Bulky. (2) there"s nothing here explicitly linking the first name of a student in firstnames to the last name of the same student in lastnames. Hopefully, the index should link them together, but if someone makes a mistake anywhere, it will get all messed up. Objects are a reference type and we"ve already used some. This means that java allows you to write your own data type using object oriented programming (oop) . This means we can create our own data types, of type object, essentially.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents

Related Questions