COMP 202 Lecture Notes - Lecture 22: Bracket, Null Pointer
hwpark22 and 40159 others unlocked
100
COMP 202 Full Course Notes
Verified Note
100 documents
Document Summary
In monday"s lecture, we started talking about classes , and making your own objects . In java, if we want to create our own data type (a data type that is an object), we have to first create a blueprint for the object. Every class file we make is a blueprint for an object that we can instantiate later on. We talked about the student class , a blueprint for creating an object of type student . Our code we wrote looked like: public class student{ public string firstname; public string lastname; public long id; public string email; We saw that it include the four student attributes. We saw that when creating attributes for a class, we have to have the variable name, the type of the variable, and the modifier up front ( public ). Once we"ve done that, we used the class file to create an object for type student. We did this in a separate file.