---
title: "Java fundamental"  
description: "JAVA FUNDAMENTALS IDENTIFIERS: In simple word identifier can be said to a name of a class, method, variable or label.it is mainly used for identific"  
author: "Anonymous User"  
published: 2018-08-31  
updated: 2020-03-04  
canonical: https://www.mindstick.com/articles/13098/java-fundamental  
category: "java"  
tags: ["java"]  
reading_time: 3 minutes  

---

# Java fundamental

**JAVA [FUNDAMENTALS](https://yourviews.mindstick.com/view/83845/healthcare-seo-fundamentals-to-grow-your-medical-practice)**

## IDENTIFIERS:

In simple word identifier can be said to a name of a class, method, [variable](https://answers.mindstick.com/qa/49024/what-year-was-variable-wing-invented-and-how) or label.it is mainly used for [identification](https://www.mindstick.com/articles/12871/technology-every-educational-institute-retail-store-needs-radio-frequency-identification) purpose.

For example:

class exmp{

[Public void](https://www.mindstick.com/interview/2715/can-we-write-static-public-void-instead-of-public-static-void) static main( String[ ] args ){

int x=10;

}

}

In above identifiers are

• Test

• Main

• String

• args

• x

## Rules for defining identifiers:

• Characters which are allowed are alphanumeric ([A-Z] [a-z] [0-9]) and symbols $ and _ are allowed.

• Identifiers should not start with any digit [0-9].

• Identifiers are case-sensitive.

• No length limit for the identifier.

• [Reserved words](https://answers.mindstick.com/qa/30468/what-are-reserved-words) cannot be used as an identifier in java.

## RESERVED WORDS:

Reserved words are used to represent certain functionalities defined by that language.

These can be divided into two parts.

• Keywords

• Reserved literals

## DATA TYPES:

**• [Numeric data](https://www.mindstick.com/interview/23094/what-is-the-common-numeric-data-types-in-mysql) type**: it is used to represent numbers.it can be divide into two type:-

1. Integral types

2. Floating types

1.Integral type: it is used to represent whole no.it can be categorized into four types:

• byte

• short

• int

• long

byte:

Size: 8 bits

Range: -128 …. 127

The most significant bit is called sign bit.0 means +ve 1 means –ve value.

+ve numbers represented directly into the memory whereas –ve numbers are represented in 2’s complement form.

For example:

byte b=100;

short:

Size: 16 bits

Range:-215 to 215[-32768 to 32767]

The most rarely used data type in java is short.

For example:

short s=-32768;

int:

Size: 32 bits

Range: -231 to 231

The most commonly used data type is int.

In java size of int is 4byte irrespective of any platform.

long:

Size: 64 bits

Range: -263 to 263

Whenever int is not enough to hold big value then we use long.

2.Floating type: used to represent real numbers.

It can be categorized into two types:

1. float

2. double

float:

Size:4 bytes

Range:-3.4e38 to 3.4e38

float follows single precision and if we want 5 to 6 decimal accuracy the we should go for float.

double:

Size:8 bytes

Range:-1.7e308 to 1.7e308

double follows double precision and if we want 14 to 15 decimal accuracy then we should go for double.

**• Boolean data type:** it is a type whose value is either [true or false](https://www.mindstick.com/forum/160329/how-can-you-convert-a-value-to-a-boolean-true-or-false-in-javascript)

Size: 1 bit

Range: not applicable

**• Char data type:** the [character](https://www.mindstick.com/articles/23551/an-investigate-distinctive-seafood-restaurant-for-your-image-stamp-character) type whose values are 16 bit [Unicode characters](https://answers.mindstick.com/qa/35625/can-you-name-some-different-text-file-formats-for-storing-unicode-characters).

Size: 4 bytes

Range:0 to 65535

\

---

Original Source: https://www.mindstick.com/articles/13098/java-fundamental

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
