Question: Consider the code: public class A { public int compute ( int x ) { return x + 1 ; } } public class B
Consider the code: public class A
public int computeint x
return x ;
public class B extends A
public int computeint x
if x
return ;
return x ;
Which of the following is true:
Question Answer
a
This code does not violate any SOLID principle
b
This code violates single responsbility principle
c
This code violates open close 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
