News for hackers. Stuff that matters.
Re:Confessions of a Ruby Developer Whose Heart was Stolen by... by Stranger2013 on Thursday June 13, 2013 @06:30AM (#5873258)
Java does not allow using reflection to access private fields !? Dude, just use C#.
Re:Confessions of a Ruby Developer Whose Heart was Stolen by... by csense on Thursday June 13, 2013 @06:38AM (#5873286)
You might be able to do it if you replace the SecurityManager or something.

We may laugh now, but it actually seemed like a good idea at the time.

Remember, a big part of Java's early use case was running untrusted remote code ("Applets") in the browesr without prompting the user (a niche now filled by JavaScript [1] and a declining Flash). Which means you really don't want that code to be able to bypass all your security by using the reflection API to read and write things it's not supposed to.

Applets never really caught on, but now the language features are constrained by backward compatibility.

Also, C# isn't supported on Android AFAIK.

[1] Mostly unrelated to Java despite its name; see http://en.wikipedia.org/wiki/Javascript#JavaScript_and_Java

Re:Confessions of a Ruby Developer Whose Heart was Stolen by... by yareally on Thursday June 13, 2013 @07:48AM (#5873505)
You can access them, it will just throw exceptions you have to catch[1].

[1]http://stackoverflow.com/questions/1196192/how-do-i-read-a-p...