문제

Would it be possible to write a quine (a program whose output is itself) in Java using the Reflection API to access the quine's code and then print it out? Such a program would still print itself out accurately even when random lines that have no effect on the output are added.

도움이 되었습니까?

해결책

I don't think so. The reflection api doesn't provide access to the actual source code, but only to class and member definitions.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top