Suppose int x=5;
double y=3;
Here x, y are varible.
Data type of x is integer
Data type of y is double (Decimal)
Answers
Answer:
please
Step-by-step explanation:
mark BRAINLIEST
Answer:
Introduction
Let's program
Know data-types
Operators
Input by user
Decide if or else
Loop loop loop
Control your loop
Have your own methods
Get values from method
Array
Characters and string
OOP
Classes and objects
Array of objects
subclass
Constructor overloading
More about methods
Abstract class
File i/o
Use of this
Data Types in Java
What if you are asked what is 2? Some of you will say that it is a number, some will say it is an integer and some will say that it is a digit.
This is exactly what we are going to learn in this section i.e. what type of data (data-type) Java uses.
Most commonly used data types in Java are int (integer), char (character), float (number having decimal), double (number having decimal), String (collection of characters) and boolean (true or false).
First, let's see the following code.
int n;
n = 4;
As discussed earlier, here int n; allocates some space in the memory to the variable 'n'.
n = 4 assigns a value 4 to the variable 'n'.
So, int n is declaring that variable 'n' is an int and allocates some space in the memory to 'n'.
Then n = 4 assigns 4 to 'n'. So, now 'n' is 4.
Thus, if you want to give a character value to 'n', then use char before 'n' (instead of int). Similarly, if we want to give a float or double value to 'x', then use float or double before 'x' respectively.
The following table states different data types along with the maximum and minimum value they can take.
Step-by-step explanation:
please follow me thanks and brainlist