AddThis

Wednesday 16 January 2019

Java data types / primitive and user defined data types

Java Data Types

  • Data type represents:
    • Type of data we want to use.
    • Amount of memory allocation required for data.
There are two types of data types:
  1. Primitive data types
  2. User defined data types
1. Primitive data types: 
  • There are 8 primitive data types available in Java.
  • 8 keywords are defined to represent 8 primitive data types.
  • Following are primitive data types: byte, short, int, long, float, double, char, boolean


2. User defined data types
  • There are four types of user defined data types:
    • Class type
    • Interface type
    • Enum type  (From Java 5)
    • Annotation type (From Java 5)


No comments:

Post a Comment

100 AWS Services in Just One Line Each

  100 AWS Services in Just One Line Each Amazon EC2:  Virtual servers in the cloud. Amazon S3:  Scalable object storage service. Amazon RDS:...