You are designing a class with several private instance vari
Solution
Note:
Could you please post the program in comment section.So that I may know what is the line 7 and line 6
______________________________
Answers:
8)
In order to update the instance variable we have to use setters methods or Mutator methods.By using these we have to modify the instance variable values.
9)
1)Accessor methods
2)get
3)Mutator methods
4)set
10)Answer)If we provide public class modifier.then jvm can able to locate the class.Then the class which is using that class could able to access it.so that we can compile and run the program.
11)
Class name and name of the java file should always be exactly same.
If we try to save the file name with different name other than the Class name we will get compilation error.
12)answer) if we delete the import statement that we cant able to compile our class..We will get compilation error during compiling the program
13)Answer) No
Reason:
We can able to run the class Calc_BMI with out the main() method.Because JVM starts the execution of the java program from the main() method.If we didnt declared the main() method with public access modifier .Then JVM couldnt able to identify the main() method.
___________________Thank You
