Computer Science, asked by Tanuyadav, 1 year ago

Different between int max=10; and const int max=10;

Answers

Answered by FemSam3362
1
int max = 10; initialises the value if max to 10 but the value may change further into the program. final int max=10; initialises the value and the value doesn't change throughout the program.

FemSam3362: therw is no const method in java but only final.
Tanuyadav: hay i m talking for c++ but thx
FemSam3362: const does the same work as final.
FemSam3362: I thought that u were speaking about java.
Similar questions