×

Multiple-Choice Questions

Web Technologies MCQs

Computer Science Subjects MCQs

Databases MCQs

Programming MCQs

Testing Software MCQs

Digital Marketing Subjects MCQs

Cloud Computing Softwares MCQs

AI/ML Subjects MCQs

Engineering Subjects MCQs

Office Related Programs MCQs

Management MCQs

More

Jython MCQs (Multiple-Choice Questions)

Jython is an implementation of the Python programming language designed to run on the Java Virtual Machine (JVM). It allows Python code to interact directly with Java classes and libraries, making it useful for applications that need to combine Python programming with the Java platform.

Jython MCQs

These Jython MCQs cover important concepts such as the JVM, Python compatibility, Java integration, Java classes and packages, Jython installation, threading, embedding Jython in Java applications, the Jython interpreter, JavaBean properties, Java arrays, and Jython's standard library.

List of Jython MCQs

The following Jython multiple-choice questions are useful for students, programmers, Python learners, Java developers, and candidates preparing for technical examinations and interviews.

1. What is Jython?

  1. An implementation of Python for the Java platform
  2. A JavaScript framework
  3. A database management system
  4. A Java compiler

Answer: A) An implementation of Python for the Java platform

Explanation:

Jython implements the Python language on the Java platform and runs on the Java Virtual Machine.

2. On which virtual machine does Jython run?

  1. Python Virtual Machine
  2. Java Virtual Machine
  3. JavaScript Virtual Machine
  4. .NET Common Language Runtime

Answer: B) Java Virtual Machine

Explanation:

Jython is designed to run on the Java Virtual Machine (JVM), allowing Python code to access Java platform capabilities.

3. Which programming language does Jython implement?

  1. Ruby
  2. Python
  3. JavaScript
  4. Perl

Answer: B) Python

Explanation:

Jython is an implementation of Python that targets the Java platform.

4. What is the primary advantage of Jython over a typical Python implementation when working with Java applications?

  1. Direct access to Java classes and libraries
  2. Automatic conversion of Python into JavaScript
  3. Removal of Python syntax
  4. Replacement of the JVM with CPython

Answer: A) Direct access to Java classes and libraries

Explanation:

Jython allows Python code to interact with Java classes and libraries directly, which is one of its main purposes.

5. Which platform is Jython particularly suited for?

  1. The Java platform
  2. Only iOS
  3. Only embedded C systems
  4. Only JavaScript browsers

Answer: A) The Java platform

Explanation:

Jython is specifically designed for the Java platform and provides integration between Python and Java.

6. Which statement correctly describes the relationship between Jython and CPython?

  1. They are two implementations of the Python language
  2. They are two Java frameworks
  3. They are database engines
  4. They are versions of Java

Answer: A) They are two implementations of the Python language

Explanation:

CPython is the reference implementation written primarily in C, while Jython implements Python for the JVM.

7. Which Python version is currently implemented by the stable Jython 2.7.x line?

  1. Python 3.14
  2. Python 3.12
  3. Python 2.7
  4. Python 1.5

Answer: C) Python 2.7

Explanation:

The current Jython 2.7.x line implements Python 2.7. Work toward a Python 3 implementation continues in the project.

8. What is the current stable Jython release according to the official Jython website?

  1. Jython 2.5.2
  2. Jython 2.7.0
  3. Jython 2.7.3
  4. Jython 2.7.4

Answer: D) Jython 2.7.4

Explanation:

The official Jython downloads page currently identifies Jython 2.7.4 as the current stable version.

9. What is Jython 2.7.5b1?

  1. A stable Python 3 release
  2. A beta version of Jython 2.7.5
  3. An older version of CPython
  4. A Java compiler

Answer: B) A beta version of Jython 2.7.5

Explanation:

The official Jython website currently lists Jython 2.7.5b1 as a beta version.

10. Which Java version is the minimum supported version for the current stable Jython 2.7.4 release?

  1. Java 5
  2. Java 6
  3. Java 8
  4. Java 17

Answer: C) Java 8

Explanation:

The official Jython downloads page states that Jython 2.7.4 is supported on Java 8 as the minimum version and Java 11.

11. What file extension is normally used for a Jython source program?

  1. .java
  2. .py
  3. .jy
  4. .jython

Answer: B) .py

Explanation:

Jython programs use Python source syntax and can be written as normal .py files. The Jython installation documentation demonstrates running a script such as script.py.

12. Which command can be used to start the Jython interpreter after installation?

  1. jython
  2. python-java
  3. java-python
  4. jvm-python

Answer: A) jython

Explanation:

After installation, the Jython launcher can be used to start the interactive Jython console.

13. Which command can be used to install Jython from its installer JAR?

  1. java -jar jython-installer-2.7.3.jar
  2. python install jython
  3. jython --install-java
  4. java install jython.py

Answer: A) java -jar jython-installer-2.7.3.jar

Explanation:

The official installation documentation describes running the installer JAR with the Java -jar option. The installer documentation page currently references the 2.7.3 installer.

14. What is the purpose of the Jython standalone JAR?

  1. To run Jython without a conventional local installation
  2. To compile JavaScript
  3. To replace the JVM
  4. To install CPython

Answer: A) To run Jython without a conventional local installation

Explanation:

The standalone JAR packages Jython so it can be run directly or placed on the classpath of a Java application.

15. Which command can run a Jython standalone JAR with a script?

  1. java -jar jython.jar script.py
  2. python jython.jar script.py
  3. jython -jar script.py
  4. java script.py jython.jar

Answer: A) java -jar jython.jar script.py

Explanation:

The official installation documentation shows that the standalone JAR can be invoked using Java's -jar option followed by the Python script.

16. Which symbol is used to begin a single-line comment in Jython?

  1. //
  2. #
  3. --
  4. /*

Answer: B) #

Explanation:

Jython follows Python syntax for comments, where a single-line comment begins with the # character.

17. Which statement about Jython syntax is generally correct?

  1. It follows Python language syntax
  2. It requires Java syntax for every statement
  3. It uses JavaScript syntax
  4. It does not support Python indentation

Answer: A) It follows Python language syntax

Explanation:

Jython implements Python, so Python language syntax is used. Java classes and APIs can additionally be accessed from Jython code.

18. Which statement demonstrates importing a Java class in Jython?

  1. from java.lang import System
  2. include java.lang.System
  3. using java.lang.System
  4. java.import System

Answer: A) from java.lang import System

Explanation:

Jython allows Java classes to be imported using Python-style import statements.

19. Which Java package contains the System class used in a typical Jython Java-integration example?

  1. java.util
  2. java.lang
  3. java.io
  4. java.net

Answer: B) java.lang

Explanation:

The Java System class belongs to the java.lang package and can be imported directly from Jython.

20. What does the following Jython statement do?

from java.lang import System
  1. Imports the Java System class
  2. Creates a Python database
  3. Starts a new JVM
  4. Imports a JavaScript library

Answer: A) Imports the Java System class

Explanation:

Jython supports importing Java classes into Python code. The statement imports System from java.lang.

21. Which Java package can be imported in Jython using Python-style import syntax?

  1. java.util
  2. java.io
  3. java.net
  4. All of the above

Answer: D) All of the above

Explanation:

Jython provides access to Java packages, including commonly used packages such as java.util, java.io, and java.net.

22. What is one of the main purposes of Jython's Java integration?

  1. To allow Python code to use Java libraries
  2. To prevent Python code from accessing Java
  3. To convert Java into JavaScript
  4. To remove the JVM

Answer: A) To allow Python code to use Java libraries

Explanation:

Jython makes it possible for Python programs to use the extensive collection of classes and libraries available on the Java platform.

23. Which statement can access the Java runtime version from Jython?

  1. System.getProperty('java.version')
  2. Java.version()
  3. jvm.version('java')
  4. java.version.get()

Answer: A) System.getProperty('java.version')

Explanation:

Jython can call Java methods directly. The System.getProperty() method can retrieve Java system properties such as the Java version.

24. Which statement about Java method calls from Jython is correct?

  1. Jython can call methods of accessible Java objects
  2. Jython cannot call Java methods
  3. Java methods must always be rewritten in Python
  4. Only static Java methods can be called

Answer: A) Jython can call methods of accessible Java objects

Explanation:

Java integration allows Jython programs to create and interact with Java objects and call their methods.

25. What happens when a Java class is instantiated from Jython?

  1. A Java object can be created and used from Jython
  2. The class is automatically converted to JavaScript
  3. The JVM is shut down
  4. The class becomes a Python module only

Answer: A) A Java object can be created and used from Jython

Explanation:

Jython provides integration that allows Python code to create instances of Java classes and interact with those objects.

26. Which feature allows Python code to subclass certain Java classes in Jython?

  1. Java integration
  2. JavaScript transpilation
  3. HTML inheritance
  4. Database mapping

Answer: A) Java integration

Explanation:

Jython supports subclassing Java classes from Python code, which is an important part of its Java integration capabilities.

27. What are JavaBean properties in Jython intended to make easier?

  1. Working with JavaBean-style properties using Python-friendly syntax
  2. Compiling Python to JavaScript
  3. Managing Python packages
  4. Creating SQL databases

Answer: A) Working with JavaBean-style properties using Python-friendly syntax

Explanation:

Jython provides support for JavaBean properties so that Java objects can be used more naturally from Python code.

28. Which Java feature can Jython provide special support for when interacting with Java classes?

  1. Java arrays
  2. JavaScript closures
  3. HTML forms
  4. CSS selectors

Answer: A) Java arrays

Explanation:

Jython documentation includes specific guidance for creating and using Java arrays from Jython.

29. Which statement about Java arrays in Jython is correct?

  1. Jython provides mechanisms for working with Java arrays
  2. Jython cannot interact with Java arrays
  3. Java arrays are always converted to SQL tables
  4. Java arrays can only be accessed through JavaScript

Answer: A) Jython provides mechanisms for working with Java arrays

Explanation:

The Jython documentation provides specific information about constructing and using Java arrays.

30. Which Jython class can be used to execute Python code from a Java application?

  1. PythonInterpreter
  2. PythonExecutor
  3. JythonCompiler
  4. JVMInterpreter

Answer: A) PythonInterpreter

Explanation:

org.python.util.PythonInterpreter can be used by Java applications to execute Jython code.

31. Which Java package contains PythonInterpreter?

  1. org.python.util
  2. org.python.java
  3. java.python.util
  4. jython.interpreter

Answer: A) org.python.util

Explanation:

The Jython API provides PythonInterpreter in the org.python.util package.

32. Which method of PythonInterpreter can execute a string of Python code?

  1. exec()
  2. runJava()
  3. executeJava()
  4. compilePython()

Answer: A) exec()

Explanation:

A Java application can use the exec() method of PythonInterpreter to execute Jython code.

33. What does embedding Jython mean?

  1. Using Jython inside a Java application
  2. Running JavaScript inside a web page
  3. Converting Python into SQL
  4. Installing CPython inside JavaScript

Answer: A) Using Jython inside a Java application

Explanation:

Embedding Jython allows Java applications to execute or interact with Python code using Jython's runtime and APIs.

34. Which standard Java mechanism can be used to integrate scripting engines such as Jython?

  1. JSR 223
  2. JDBC
  3. JPA
  4. JNDI only

Answer: A) JSR 223

Explanation:

JSR 223 defines a Java scripting API that can be used to integrate scripting languages with Java applications.

35. Which statement best describes Jython threading?

  1. Jython runs on the JVM and does not have CPython's Global Interpreter Lock
  2. Jython does not support threads
  3. Jython always uses CPython's GIL
  4. Jython uses JavaScript threads

Answer: A) Jython runs on the JVM and does not have CPython's Global Interpreter Lock

Explanation:

The Jython documentation notes that Jython does not have the Global Interpreter Lock used by CPython and uses Java's threading facilities.

36. Which statement about Jython and the Global Interpreter Lock (GIL) is correct?

  1. Jython has no GIL like CPython
  2. Jython requires the CPython GIL
  3. Jython uses a JavaScript GIL
  4. Jython disables all threads

Answer: A) Jython has no GIL like CPython

Explanation:

Unlike CPython, Jython does not use a Global Interpreter Lock, which is an important implementation difference.

37. Which memory-management mechanism is associated with Jython?

  1. JVM garbage collection
  2. CPython reference counting only
  3. JavaScript garbage collection only
  4. No memory management

Answer: A) JVM garbage collection

Explanation:

Jython runs on the JVM and therefore relies on the JVM's memory-management and garbage-collection mechanisms rather than CPython's reference-counting implementation.

38. Why can CPython C extension modules be a problem when using Jython?

  1. Jython cannot directly use CPython extensions written in C in the same way CPython does
  2. Jython cannot execute Python code
  3. Java does not support libraries
  4. Jython cannot import any modules

Answer: A) Jython cannot directly use CPython extensions written in C in the same way CPython does

Explanation:

Jython cannot use CPython extension modules that depend on native C implementation in the same way as CPython. Pure Python or Java-based alternatives may be required.

39. Which type of Python library is generally easier for Jython to use?

  1. Pure Python libraries
  2. Only C-extension libraries
  3. Only JavaScript libraries
  4. Only binary Windows DLLs

Answer: A) Pure Python libraries

Explanation:

Pure Python code is generally more portable between Python implementations. Libraries that depend on CPython-specific C extensions may require alternatives when used with Jython.

40. What is the Jython registry?

  1. A configuration mechanism used by Jython
  2. A Java database
  3. A Python package repository
  4. A web server

Answer: A) A configuration mechanism used by Jython

Explanation:

Jython provides a registry containing configuration properties used to control aspects of the Jython environment.

41. Which type of information can be configured through the Jython registry?

  1. Jython runtime and environment properties
  2. Only HTML styles
  3. Only SQL queries
  4. Only JavaScript variables

Answer: A) Jython runtime and environment properties

Explanation:

The Jython registry provides configuration properties for the Jython runtime and related environment behavior.

42. Which area is specifically supported by Jython's Java integration?

  1. Calling Java methods
  2. Creating Java objects
  3. Using Java packages
  4. All of the above

Answer: D) All of the above

Explanation:

Jython's Java integration allows Python programs to import Java classes, create Java objects, call Java methods, and work with Java packages.

43. Which statement about Java methods with overloaded signatures is relevant to Jython?

  1. Jython provides mechanisms for working with overloaded Java methods
  2. Jython cannot call overloaded methods
  3. Java methods are automatically converted to SQL
  4. Overloading is available only in JavaScript

Answer: A) Jython provides mechanisms for working with overloaded Java methods

Explanation:

Because Java supports method overloading, Jython provides mechanisms for selecting and invoking appropriate Java method signatures.

44. Which statement about Python keywords and Java members is important in Jython?

  1. Special handling may be required when Java member names conflict with Python keywords
  2. Java keywords are automatically removed
  3. Python cannot access Java members
  4. All Java methods must be renamed

Answer: A) Special handling may be required when Java member names conflict with Python keywords

Explanation:

Jython documentation discusses naming conflicts that can occur when Java classes contain names that have special meaning as Python keywords.

45. Which application scenario is well suited to Jython?

  1. Adding scripting capabilities to a Java application
  2. Writing only native C operating-system kernels
  3. Replacing every Java library with JavaScript
  4. Creating only static HTML pages

Answer: A) Adding scripting capabilities to a Java application

Explanation:

One of Jython's documented uses is embedded scripting, where Java applications allow users or developers to add functionality through Python scripts.

46. What is one use of Jython for Java developers?

  1. Interactive experimentation with Java packages
  2. Removing the JVM
  3. Replacing Java bytecode with HTML
  4. Converting Java into SQL

Answer: A) Interactive experimentation with Java packages

Explanation:

Jython provides an interactive interpreter that can be used to experiment with Java packages and running Java applications.

47. Which database technology can be accessed from Jython through Java database APIs?

  1. Databases accessible through JDBC
  2. Only text files
  3. Only browser cookies
  4. Only JavaScript databases

Answer: A) Databases accessible through JDBC

Explanation:

Because Jython runs on the JVM and can use Java libraries, it can work with Java database connectivity APIs and JDBC-compatible database systems.

48. Which statement about Jython's standard library compatibility is correct?

  1. Many standard Python library modules are available, but implementation differences exist
  2. No Python standard library modules are available
  3. Only Java libraries can be used
  4. Every CPython extension works without modification

Answer: A) Many standard Python library modules are available, but implementation differences exist

Explanation:

Jython follows the Python language and provides many standard library modules, but some modules require different implementations on the JVM and some CPython-specific extensions are not directly compatible.

49. Which statement correctly describes Jython's relationship with Java?

  1. Jython allows Python code and Java code to work together on the JVM
  2. Jython prevents Python code from accessing Java
  3. Jython replaces Java with Python bytecode
  4. Jython is unrelated to the Java platform

Answer: A) Jython allows Python code and Java code to work together on the JVM

Explanation:

Java integration is at the heart of Jython. Python code can use Java classes and libraries, while Java applications can embed and execute Jython code.

50. Which statement best summarizes Jython?

  1. It is Python implemented for the JVM with direct access to Java functionality
  2. It is a JavaScript framework for browsers
  3. It is a replacement for the Java Virtual Machine
  4. It is a database programming language

Answer: A) It is Python implemented for the JVM with direct access to Java functionality

Explanation:

Jython combines Python language capabilities with the Java platform. It runs on the JVM and allows Python programs to interact with Java classes, libraries, and applications.

Advertisement
Advertisement

Comments and Discussions!

Load comments ↻


Advertisement
Advertisement
Advertisement

Copyright © 2026 www.includehelp.com. All rights reserved.