Add files via upload
This commit is contained in:
parent
f76d6bd668
commit
565f69ecf3
@ -1,7 +1,5 @@
|
||||
package com.baeldung.markerinterface;
|
||||
|
||||
public interface DeletableShape {
|
||||
double getArea();
|
||||
public interface DeletableShape extends Shape {
|
||||
|
||||
double getCircumference();
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.baeldung.markerinterface;
|
||||
|
||||
public class Rectangle implements Deletable {
|
||||
public class Rectangle implements DeletableShape {
|
||||
|
||||
private double width;
|
||||
private double height;
|
||||
|
@ -0,0 +1,6 @@
|
||||
package com.baeldung.markerinterface;
|
||||
|
||||
public interface Shape {
|
||||
double getArea();
|
||||
double getCircumference();
|
||||
}
|
@ -3,7 +3,7 @@ package com.baeldung.markerinterface;
|
||||
public class ShapeDao {
|
||||
|
||||
public boolean delete(Object object) {
|
||||
if (!(object instanceof Deletable)) {
|
||||
if (!(object instanceof DeletableShape)) {
|
||||
return false;
|
||||
}
|
||||
// Calling the code that deletes the entity from the database
|
||||
|
Loading…
x
Reference in New Issue
Block a user