ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
Data Types
Data Types in Java
1. Primitive data types: The primitive data types include boolean, char,
byte, short, int, long, float and double.
2. Non-primitive/User Define data types: The non-primitive data types
include Classes, Interfaces, and Arrays.
Should Remember
1. Lower type summation with higher type return higher data type
2. Java allow underscore in number
3. Assigning Higher type in lower type variable is compilation error
Non-primitive Type
? Know as user define type.
? Also known as Reference type.
Reserved Words in java
Create User Define data type
? Use the class keyword
? Class name.
? Define class with property and method
Student Data Type
? Attributes
? Roll : int
? Name : String
? Registration Number : int
? Emain : String
? Behaviors
? Read
? write
Value Overflow
The var keyword
? Available from java 9
? Only for local variable
? Can¡¯t use as method/constructor parameter
? Have to assign in declaration line

More Related Content

Data types in Java

  • 2. Data Types in Java 1. Primitive data types: The primitive data types include boolean, char, byte, short, int, long, float and double. 2. Non-primitive/User Define data types: The non-primitive data types include Classes, Interfaces, and Arrays.
  • 3. Should Remember 1. Lower type summation with higher type return higher data type 2. Java allow underscore in number 3. Assigning Higher type in lower type variable is compilation error
  • 4. Non-primitive Type ? Know as user define type. ? Also known as Reference type.
  • 6. Create User Define data type ? Use the class keyword ? Class name. ? Define class with property and method
  • 7. Student Data Type ? Attributes ? Roll : int ? Name : String ? Registration Number : int ? Emain : String ? Behaviors ? Read ? write
  • 9. The var keyword ? Available from java 9 ? Only for local variable ? Can¡¯t use as method/constructor parameter ? Have to assign in declaration line