314 Object-Based Programming Chapter 8 // Fig. 8.13: (Ftp web hosting)
314 Object-Based Programming Chapter 8 // Fig. 8.13: Employee.cs // Employee class contains static data and a static method. using System; // Employee class definition public class Employee { private string firstName; private string lastName; private static int count; // Employee objects in memory // constructor increments static Employee count public Employee( string fName, string lName ) { firstName = fName; lastName = lName; ++count; Console.WriteLine( “Employee object constructor: ” + firstName + ” ” + lastName + “; count = ” + Count ); } // destructor decrements static Employee count ~Employee() { –count; Console.WriteLine( “Employee object destructor: ” + firstName + ” ” + lastName + “; count = ” + Count ); } // FirstName property public string FirstName { get { return firstName; } } // LastName property public string LastName { get { return lastName; } } Fig. 8.13 Fig. 8.13Fig. 8.FiFi13g. 8.13g. 8.13staticmembers are accessible to all objects of a class. (Part 1 of 2.)
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision J2ee Web Hosting services.