COMP 1405 Lecture Notes - Object File, Type Class
Document Summary
//declares string names firstname1 = hank; lastname1 = urchif; firstname2 = holly; lastname2 = day; firstname3 = bobby; lastname3 = socks; //set string values public static void main (string args[]) { //the following program shows the usage of string data type class ch2_0string3 { //class object required for the ch2_1person and ch2_1person2 program class ch2_1personobject { //declares 2 string names in the object file. //other data types such as int, char and boolean etc can also be used here. //the following program demonstrates the usage of class objects class ch2_1person { public static void main (string args[]) { //declares an object name aperson = new ch2_1personobject(); //creates a new ch2_1personobject aperson. firstname = hank; aperson. lastname = urchif; //sets values to the firstname and lastname string in the. //ch2_1personobject class means an component (such as variable, function etc) with an class. //outputs the same result as the previous program aperson. firstname = max; aperson. lastname = power;