1.

What does Rhino do when the getter and setter methods exist?(a) It becomes JavaScript properties(b) Java classes are used to avoid them(c) Java classes & JavaScript properties(d) It act as javascript functionI have been asked this question in an interview for internship.The doubt is from Scripting Java with Rhino in portion Server-Side and Client-Side Scripting of JavaScript

Answer»

The correct OPTION is (a) It becomes JavaScript PROPERTIES

The best I can explain: Rhino ALLOWS JavaScript code to QUERY and set the static fields of Java classes and the instance fields of Java objects. Java classes often avoid defining public fields in favor of getter and setter methods. When getter and setter methods exist, Rhino EXPOSES them as JavaScript properties.



Discussion

No Comment Found

Related InterviewSolutions