Java Types

In this section we're going to cover how Python handles the conversion from Java types when you pass arguments to Java methods and when those methods return values. First, though, let's briefly cover the Java basic types:

  • boolean— contains true or false

  • char— contains Unicode characters

  • byte— contains 8-bit signed integers

  • short— contains 16-bit signed integers

  • int— contains 32-bit signed integers

  • long— contains 64-bit signed integers

  • float— contains 32-bit floating-point numbers

  • double— contains 64-bit floating-point numbers

  • String— contains a string of Unicode characters

  • array— contains arrays of objects or primitive types

Primitive versus Basic Types

I define as Java basic types all of the primitive types plus any classes that have special ...

Get Python Programming with the Java™ Class Libraries: A Tutorial for Building Web and Enterprise Applications with Jython now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.