Похожие чаты

Can anyone please tell what is the use of this

keyword here? its used because the local variable name and instance variable names are same or to is it working like Point2D.x = x; and Point3D.y = y; ?

13 ответов

8 просмотров

this means instance of that class.

ANDRIO- Автор вопроса

So the x and y which user passes are stored in the variables of instance of that class.

ANDRIO- Автор вопроса
eh
So the x and y which user passes are stored in the...

will it not store if we write x = x; and y = y; ?

ANDRIO
will it not store if we write x = x; and y = y; ?

This will take x as the variable name that u got from the constructor

Btw make it private and can use getter setters

ANDRIO- Автор вопроса
ANDRIO- Автор вопроса
eh
This will take x as the variable name that u got f...

sorry to bother. but will using same variable names in parameters not cause any problem?

ANDRIO- Автор вопроса
eh
No u just have to return a value

hey how do i return the value? when i do return x; or return this.x; in parameterized constructor of Point3D class. it gives error: incompatible types: unexpected return value

ANDRIO- Автор вопроса

Похожие вопросы

Обсуждают сегодня

Какие дистрибутивы Linux чаще всего работают в качестве серверов и почему?
Alex
27
Такс, блин, таки кто-то знает, каким образом работают макросы stdin/stdout/stderr? Я влез в stdio.h, там определения нет, отладил через асмокод - вызывается функция со странны...
The Bird of Hermes
18
Ребят, привет! Я портируюсь с войда на генту Читаю гентувики В разделе про разбивку диска указана xfs файловая система, а не ext4, как обычно Xfs имеет какие-то преимущества ...
Андрей Дыбов
21
А кто-то пробовал, уезжая из Эстонии получить э-рез и продолжить вести предпринимательскую деятельность внутри Эстонии, используя свой OÜ?
Lalalashechki Lalala
62
can anyone here tell me the exact liqudation % when i supplied 100 usdt and borrowed bnb with borrow limit used 66.21 % ? usually bnb borrow limit is 80% and i guess 85 ...
jacky chan
9
я не магистр хаскеля, но разве не может лейзи тип конвертнуться в не-лейзи запросив вычисление содержимого прям при инициализации?
deadgnom32 λ madao
100
Всем привет, на линуксе лучше на fasm или nasm учиться писать для начала ?
meszjol
14
Lol is just wrote a long text about tokenomics etc and it was directly deleted, no curses or similar so i write it again in shorter. Hey Ben 600m eco system tokens, around 30...
. Duss
3
Is Kadena onto something special? No one really knows. Good luck!
Bright Uncle Stephen EqualBet
40
I'm new at Monero and I'd like to ask you all - why are you in Monero? I know about privacy but what do you expect to happen in the next years, decades that Monero will make i...
Konrad
19
Карта сайта