Does Java support referential transparency? What about in static contexts like a? What about in object contexts like b? Explain using the following bits of code to explain your answer for each...


Does Java support referential transparency? What<br>about in static contexts like a? What about in object<br>contexts like b? Explain using the following bits of<br>code to explain your answer for each question.<br>a)<br>• static int a,b,c;//declaration<br>• //some stuff happens<br>• result1 = (fun(a) + b) / (fun(a) – c);<br>• temp = fun(a);<br>• result2 = (temp + b) / (temp - c);<br>• /function signature<br>• int static fun(int arg);<br>%3D<br>%3D<br>b)<br>• Employee a = new Employee();<br>• Employee b = new Employee();<br>• Employee c= new Employee();<br>• //some stuff happens<br>• result1 = (a.fun() + b) / (a.fun() – c);<br>• temp = a.fun();<br>• result2 = (temp + b) / (temp - c);<br>• //function signature inside Employee:<br>• int fun()<br>%3D<br>

Extracted text: Does Java support referential transparency? What about in static contexts like a? What about in object contexts like b? Explain using the following bits of code to explain your answer for each question. a) • static int a,b,c;//declaration • //some stuff happens • result1 = (fun(a) + b) / (fun(a) – c); • temp = fun(a); • result2 = (temp + b) / (temp - c); • /function signature • int static fun(int arg); %3D %3D b) • Employee a = new Employee(); • Employee b = new Employee(); • Employee c= new Employee(); • //some stuff happens • result1 = (a.fun() + b) / (a.fun() – c); • temp = a.fun(); • result2 = (temp + b) / (temp - c); • //function signature inside Employee: • int fun() %3D

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here