Computer Science, asked by Bellesahrasah8978, 1 year ago

What is local class? Give example.

Answers

Answered by Monica695
0
A local class is defined within a block of a statement , like a method / function.It is different than inner / nested classes in the aspect that inner classes are defined within the scope of the enclosing class, whereas, local classes operate within the scope of the enclosing method.Hence, local classes can access local variables defined in the container method, apart from accessing all members of the enclosing class. For Example = Validates two phone numbers... Plzzzz mark my answer as brain list.
Similar questions