Enrol to start learning
Reading is open to everyone. Enrolling is free, and it is what unlocks the audio lessons, practice tests and progress tracking.
29. Introduction to Scripting in Java (e.g., JavaScript Engine)
This section
Practice test
13 questions on this section. Wrong answers show you what to read again.
Sign up to take itWhole chapter
Revision test
Mixed questions from across the chapter. Your answers get marked.
Sign up to take itQuick
Flashcard drill
5 cards from this lesson. Good the night before a test.
Try these first
- 1.
What does the Java Scripting API allow developers to do?
Hint
Think about what it means to integrate scripting languages.
- 2.
What is Nashorn?
Hint
Recall the evolution of JavaScript engines in Java.
- 3.
What does the Java Scripting API allow you to do?
- A. Only execute Java code
- B. Embed and execute scripts in Java
- C. Compile Java code only
Hint
Think about the integration aspect.
- 4.
True or False: Nashorn is still actively maintained in Java.
- True
- False
Hint
Check the version history of Java.
- 5.
Create a Nashorn script that takes user input to calculate the area of a rectangle.
Hint
Consider how to prompt the user for input and use it in a calculation.
- 6.
Discuss how the limitations of Nashorn could affect its use in a modern web application.
Hint
Think about the requirements of current applications and the implications of those limitations.
Exercises
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting
4 more questions available
Enrol freeQuiz
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting
3 more questions available
Enrol freeChallenge Problems
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting