Answer Posted / khizar khan
1) Make a class fianl like final class A{}
2) Then use the property as private and final
ex:
final class A{
private final int salary;
}
3)Now make a Constructor to initilize the values
ex:
A(int a)
{ this .salary=a;
}
4)Now use the gtter mathod to acces the values
ex:
final class A{
private final int salary ;
A( int a)
{
this.salary=a;
}
public int getSalary()
{
return salary;
}
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
define the terminology association.
What is boolean query?
why Java does not support multiple inheritances?
What is the difference between call by reference and call by pointer?
Is java written in c?
What is a text string?
Is age discrete or continuous?
What is a numeric digit?
What are the differences between getting and load method?
How do you identify if jvm is 32-bit or 64-bit from java program?
Tell me about different OOPS concepts.
What is a buffer in computer?
What is the difference between actual and formal parameters?
If a variable is declared as private, where may the variable be accessed?
What is the difference between multitasking and multithreading in Java