Computer Science, asked by UniquePrincess1234, 7 months ago

How can you initialise a class member within a class? ​

Answers

Answered by Anonymous
1

Answer:

To initialize a class member variable, put the initialization code in a static initialization block, as the following section shows. To initialize an instance member variable, put the initialization code in a constructor.

Explanation:

Hope this answer is helpful for you.

Thank you.

PLEASE MARK ME BRAINLIEST

Answered by avinash9631
1

To initialize a class member variable, put the initialization code in a static initialization block, as the following section shows. To initialize an instance member variable, put the initialization code in a constructor.

Similar questions