Syntax

Java Primitive Types Syntax

In Java, primitive types: java's built-in primitive types — byte short int long float double boolean char

Quick Answer

Syntax
byte short int long float double boolean char
JavaSyntax

Primitive Types

Code example
byte short int long float double boolean char

Java's built-in primitive types.

Learn More

How to primitive types in Java

  1. Open your Java file or editor.
  2. Copy the example, then replace its sample names and values for your code.

Java Primitive Types Syntax

Use byte short int long float double boolean char.

Related Syntax References

Frequently asked questions

What is the Java syntax for primitive types?

Use this pattern: byte short int long float double boolean char

Can I copy this Java code example?

Yes. Use Copy code and adapt the example to your program.

Is this Java syntax different on Mac or Windows?

No. The language syntax is the same across operating systems.

Official source · How we verify