Created
November 9, 2013 05:33
-
-
Save The-Yoda/7382110 to your computer and use it in GitHub Desktop.
Scala: Getting method names of a class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//obj is object of a class | |
var params : Array[String] = obj.getClass.getMethods.map(_.getName) | |
var j : Int = 0 | |
while ({j < params.length}){ | |
println(params(j)) | |
j = j + 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment