Is there any way to link 2 classes of java together ?if yes them how. | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 1

Is there any way to link 2 classes of java together ?if yes them how.

java

8th Mar 2018, 4:04 AM
Aditya Gupta
Aditya Gupta - avatar
2 Respuestas
+ 2
Inheritance between the two, then they share attributes, objects, and functions, etc.
8th Mar 2018, 4:05 AM
Dread
Dread - avatar
+ 1
but how can we link the 2 with each other . is: if a line is to be printed on the main class but the data for the line is to be taken from the sub-classes
8th Mar 2018, 4:09 AM
Aditya Gupta
Aditya Gupta - avatar