Q1014 Notice that the class name is in line 7 calc BMI there
Q10.14 Notice that the class name is in line 7: calc BMI. there are four same name methods from LINE 13 to 16, what do we call these wethods; ANS but Q10.15 Notice that in line 18, we have public void cale BMI, is also has it does not cause sywax erron same name as of the class name, why Q10.16 Why do we need methods in LINE 21 & for what function? What is the common name for thesekinds of methods? Q10.17 Why do we need methods in LINE 23 &24 for what function? What is the common name for these kinds methods? AN of Q10.18 Line and 24, the method names are prefixed with three specific letters, would the compiler marked them as syntax crror if you use other letters for the prefix? ANS: cycle: YES or NO Q10.19 Take a look atthe method in LINE 26 which has a primitive type of double which behaves ike function, doesjavahas nanction? ANS java has specific function statement just like LINE 26 (cycle: YES or NO ANS: java has no specific function statement instead it uses method to return the value cycle: YES or No Q10.20 When you activate (invoke) the class Calc BMI by a main method Line 41) with the invoking (Line 44) of a constructor in the class, how does the java loading system find out which constructor to be used for the initialization process? ANS: Q10.2 ANS (2): circle Yes or No ANS (I) Q10.22 There are two o/P methods in the class with same name, and the driving main invokes both methods for console & GUI styles op. How does the java distinguishing which one should be invoked? What is the function feature name that java uses to determine? ANS:
Solution
14. these are known as constructors.
15. It does not throw any syntax error because it is a constructor and constructor has the mane same as the class.
16. the functions are used to assign values to the variables. these are known as set methods
17. the functions are used to provide access to the values that the variables hold. These are known as get methods
18. yes. those three letters recognize the methods. if we replace them then the compiler will not be able to identify the job related to defined methods.
19. ans1.NO
ans2.Yes
