C#


abstract class Motorcycle { // Anyone can call this. public void StartEngine() {/* Method statements here */ } // Only derived classes can call this. protected void AddGas(int gallons) { /* Method statements here */ } // Derived classes can override the base class implementation. public virtual int Drive(int miles, int speed) { /* Method statements here */ return 1; } // Derived classes must implement this. public abstract double GetTopSpeed(); }




JAVA


setReadOnlypublic boolean setReadOnly()
Marks the file or directory named by this abstract pathname so that only read operations are allowed. After invoking this method the file or directory is guaranteed not to change until it is either deleted or marked to allow write access. Whether or not a read-only file or directory may be deleted depends upon the underlying system.
Returns:true if and only if the operation succeeded; false otherwiseThrows:SecurityException - If a security manager exists and its SecurityManager.checkWrite(java.lang.String) method denies write access to the named fileSince:1.2