What are the examples of data value/ R-value and location value /L- value in java???
Answers
Answered by
1
__________________ example _____________________
============= >>>>>>>>>>>>>>>>>
= shows several different kinds of values and values
______________________________________
answer
==========
---------------------
class number
{
public: number
(int i = 0) : value(i)
{}
operator int( )
const
{ return value; }
number& operator=(const number& n);
private: int value; }; number operator+(const number& x, const number& y);
int main( ) { number a[10], b(42); number* p; a; // lvalue a[0]; // lvalue &a[0]; // rvalue *a; // lvalue p; // lvalue *p; //
lvalue 10;
// rvalue number(10);
// rvalue a[0] + b; // rvalue b = a[0]; // lvalue
}
============= >>>>>>>>>>>>>>>>>
= shows several different kinds of values and values
______________________________________
answer
==========
---------------------
class number
{
public: number
(int i = 0) : value(i)
{}
operator int( )
const
{ return value; }
number& operator=(const number& n);
private: int value; }; number operator+(const number& x, const number& y);
int main( ) { number a[10], b(42); number* p; a; // lvalue a[0]; // lvalue &a[0]; // rvalue *a; // lvalue p; // lvalue *p; //
lvalue 10;
// rvalue number(10);
// rvalue a[0] + b; // rvalue b = a[0]; // lvalue
}
Similar questions