celebforum  

Zurück   celebforum > >

Celebrity Caps & Collagen Videocaps, Rawcaps von berühmten Celebs

 
 
Themen-Optionen

”`java // Bad example public interface Worker {

@Override public void

@Override public void work() { // implementation } @Override public void eat() { // implementation } @Override public void sleep() { // implementation } }

// Bad example public class Shape { public void draw() { if (this instanceof Circle) { // draw circle } else if (this instanceof Rectangle) { // draw rectangle } } } // Good example public abstract class Shape { public abstract void draw(); } public class Circle extends Shape { @Override public void draw() { // draw circle } } public class Rectangle extends Shape { @Override public void draw() { // draw rectangle } } The Liskov Substitution Principle states that subtypes should be substitutable for their base types. This principle ensures that you can use a subclass anywhere a superclass is expected.

void work(); void eat(); void sleep(); }

public class Human implements Worker {

Java Oop Done Right Pdf -

”`java // Bad example public interface Worker {

@Override public void

@Override public void work() { // implementation } @Override public void eat() { // implementation } @Override public void sleep() { // implementation } } java oop done right pdf

// Bad example public class Shape { public void draw() { if (this instanceof Circle) { // draw circle } else if (this instanceof Rectangle) { // draw rectangle } } } // Good example public abstract class Shape { public abstract void draw(); } public class Circle extends Shape { @Override public void draw() { // draw circle } } public class Rectangle extends Shape { @Override public void draw() { // draw rectangle } } The Liskov Substitution Principle states that subtypes should be substitutable for their base types. This principle ensures that you can use a subclass anywhere a superclass is expected. ”`java // Bad example public interface Worker {

void work(); void eat(); void sleep(); } java oop done right pdf

public class Human implements Worker {


Powered by vBulletin® Version 3.8.11 (Deutsch)
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.