Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
Java
(view source)
Revision as of 10:19, 2 April 2015
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 />
Rafahsolis
Bureaucrats
,
Administrators
2,306
edits
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
Variants
Views
Read
View source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
Special pages
Printable version