Changes

Jump to navigation Jump to search
567 bytes added ,  10:19, 2 April 2015
no edit summary
Line 235: Line 235:  
[https://github.com/rafahsolis/javaTutorial/blob/master/StringBuilderBufferFormatting.java example code]
 
[https://github.com/rafahsolis/javaTutorial/blob/master/StringBuilderBufferFormatting.java example code]
    +
== Inheritance ==
 +
Use key word extends at the class declaration<br />
 +
private variables and methods are not inherited.<br />
 +
protected would be the appropiated declaration to be able to inherit variables without being public.
 +
<source lang="java">
 +
public class Car extends Machine {
 +
}</source>
 +
sample code files:
 +
[https://github.com/rafahsolis/javaTutorial/blob/master/inheritance.java inheritance.java]<br />
 +
[https://github.com/rafahsolis/javaTutorial/blob/master/Machine.java Machine.java]
 +
[https://github.com/rafahsolis/javaTutorial/blob/master/Car.java Car.java]
 
== Eclipse shortcuts ==
 
== Eclipse shortcuts ==
 
Ctrl + Space → Autocomplete.<br />
 
Ctrl + Space → Autocomplete.<br />

Navigation menu