Modifiers modifiers modifiers public static page 4

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: but with the static modifier in addition. <modifiers> Modifiers Modifiers public static Page 4 <data type> <attribute name> ; Data Type Data Type int Name Name studentNumber ; Dr. S. GANNOUNI & Dr. A. TOUIR Introduction to OOP Class Attributes Access • Class attributes (and methods) can also be manipulated without creating an instance of the class. <class name>.<attribute name> Class Name Class Name Attribute Name Attribute Name Course.studentNumber = 0 ; Page 5 Dr. S. GANNOUNI & Dr. A. TOUIR Introduction to OOP class Course { // attributes public String studentName; public String courseCode ; public static int studentNumber; } public class CourseRegistration { public static void main(String args) { Course course1, course2; //Creat...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online