If i have so much attributes what attributes i will add in constructor? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

If i have so much attributes what attributes i will add in constructor?

For example, I have a assignment about design and implementation. In assignment, I have a class name Student with a lot of attributes: id, firstName, givenName, lastName, email, address, phone, dob, gender Somebody can help me. Many thankssss

8th Apr 2019, 6:27 AM
Ha Nguyen
Ha Nguyen - avatar
1 Answer
+ 7
You can add as many properties as u want in the constructor. You can add all the properties of students in the constructor.
8th Apr 2019, 7:23 AM
Arushi Singhania
Arushi Singhania - avatar