1.

Which is a more formal way of importing packages and classes as JavaScript objects?(a) import(java.util.*);(b) importClass(java.util.*);(c) import.Class(java.util.*);(d) Class.import(java.util.*);The question was asked in exam.This interesting question is from Scripting Java with Rhino topic in portion Server-Side and Client-Side Scripting of JavaScript

Answer»

Right option is (b) importClass(java.util.*);

Easy explanation: Because packages and CLASSES are represented as JavaScript objects, you can assign them to VARIABLES to GIVE them shorter names. But you can ALSO more FORMALLY import them, if you want to:



Discussion

No Comment Found

Related InterviewSolutions