Can we use property of class in another class in a same program? If yes then how | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can we use property of class in another class in a same program? If yes then how

plzzz give it an example

16th May 2018, 5:00 PM
Harsh Agrawal
Harsh Agrawal - avatar
3 Answers
+ 4
yeah it's called inheritance. Just see java or c++ course of sololearn.
16th May 2018, 6:45 PM
Dhruv garg
Dhruv garg - avatar
+ 1
do you mean, something a bit like in this (simplistic) example? https://code.sololearn.com/cM3lFGUyMfTY/?ref=app
16th May 2018, 5:13 PM
ifl
ifl - avatar
+ 1
You can use a public properties and methods defined in another class , also protected properties/methods from a parent class
16th May 2018, 7:14 PM
ifl
ifl - avatar