+ 1
What is the true function of the operator (===)?
what does it do?
9 odpowiedzi
+ 5
it returns true if both the value and the data type is same among the operand variables
+ 4
its also used for arrays in java. like
eg:a===b
is true if both a & b have same order, same value and same type.
+ 4
its "mohsin" @rose. well my teachers also make mistake while they call my name. :)
+ 1
thank you moshin
+ 1
I just mistyped it mohsin but still thank u 4 your answer
+ 1
may be you got your answer..then also.,
=== means "identical to"
if both value and datatype are same then it gives 1 or true..otherwise 0 or false.
0
It checks the value and data type,
Int a=1
Int b=1
Char c='1'
Double d=1.0
a===b returns true
a===c returns false
a===d returns false
0
If you mean == it means if it is equal,
and = is to asign it.
So if you write if(a = b) it is like you are asigning b to a in the if statement, resulting in a syntax error
- 1
if im not mistaken it check if the type is the same.
int a = 1;
int b = 2;
char c = z;
c===b return false.
a===b return true.