Skip to content
Advertisement

Tag: function

Nested functions in Java

Are there any extensions for the Java programming language that make it possible to create nested functions? There are many situations where I need to create methods that are only used once in the context of another method or for-loop. I’ve been unable to accomplish this in Java so far, even though it can be done easily in JavaScript. For

calling numbered function name in loop using java reflection

i have a problem as : MyFirstClass.java MySecondClass.java TestClass.java I want to use java reflection and call the pObj.getP**Param() methods in for loop by providing the parameters to g How it can be made possible. I don’t want to use array of p*Params. Thanks in advance. Answer Are you sure this is what you need? For me, your code seems

Advertisement