Home > Java > javaTutorial > body text

What can be followed by int in java?

下次还敢
Release: 2024-04-28 23:48:17
Original
510 people have browsed it

int suffix represents various formats of int type in Java: No suffix: Decimal integer L: Long integer constant l: Same as above 0: Octal integer x: Hexadecimal integer f: Single-precision floating point number d : Double precision floating point number

What can be followed by int in java?

int suffix

In Java, int type follows The following suffixes can be used:

Basic suffix

  • No suffix: represents a decimal integer. For example: 100
  • #L: represents a long integer constant. For example: 100L
  • l: Same as above. For example: 100l

Base suffix

  • 0: represents an octal integer. For example: 0100
  • 0x: represents a hexadecimal integer. For example: 0xFF

Floating point suffix

  • f: represents a single-precision floating point number. For example: 100.0f
  • d: represents a double-precision floating point number. For example: 100.0d
  • F: Same as above. For example: 100.0F
  • D: Same as above. For example: 100.0D

##Other

  • _: Underscores can be used to improve code readability sex, dividing the number into smaller parts. For example: 1_000_000
  • Variable length parameters: ... can be used to represent variable length parameter methods. For example: public void myMethod(int... numbers)

The above is the detailed content of What can be followed by int in java?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!