CSE 219 Lecture Notes - Lecture 1: Multiple Inheritance, Covariance
Document Summary
Not everything in java is an object-- primitive types are not objects: short, int, long, float, char, boolean, double, byte. Can only inherit from a single class. By default, a class that does not explicitly inherit a class implements the object class. You can access a super class by using the super keyword i. e. super(age) You don"t need to use the super keyword when using inherited methods, assuming that the method is not overridden. You can override an inherited method- just redefine the class. It is good practice to annotate code the new method. When you override something, you should put @override in the line before. @override public double getage() { return super. getage() - 10; When two methods have the same name, but have different signatures/arguments. Public double add( double arg1, double arg2 ) Public double add( double arg1, double arg2, double3 ) When overriding a method, the entire signature must be the same.