Referential transparency is a concept in functional programming where an expression can be replaced with its value without changing the behaviour of the program. In other words, calling a function with the same input parameters will always produce the same output without causing any side effects.
Referentially transparent function example in Java.
- Same inputs will always provide the same outputs..
- No state changes outside of its function scope implies no side effects.