Question: Consider the code: public class A { public int compute ( int x ) { if ( x < 0 ) return 0 ; return
Consider the code:
public class A
public int computeint x
if x
return ;
return x ;
public class B extends A
@Override
public int computeint x
return x;
Which of the following is true:
a
This code does not violate any of SOLID principles
b
This code violates single responsibility principle
c
This code violates openclose principle
d
This code violates Liskov substitution principle
e
This code violates interface segregation principle
f
This code violates dependency inversion principle
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
