Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package Testing;
- /**
- *
- * @author HP
- */
- class House {
- public void color(){
- System.out.println("Ini pintu rumah saya");
- }
- }
- class Window extends House{
- @Override
- public void color(){
- System.out.println("Jendela berwarna putih");
- }
- public void panjang(){
- System.out.println("Panjangnya 15 meter");
- }
- }
- public class MyHouse{
- public static void main(String[] args) {
- House a = new House();
- House b = new Window();
- a.color();
- b.color();
- b.panjang();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement