What will be returned from following method? public static double Method A() {do
ID: 3811639 • Letter: W
Question
What will be returned from following method? public static double Method A() {double a = 8.5 + 9.5; return a;} a) 18.0 b) 18 c) 8 d) This is an error Breaking a program down into small manageable methods a) Makes problems more easily solved b) Allows for code reuse c) Amplifies programs d) All of the above In the following code. Integer. parseInt(st 1), is an example of _____ int num; String st1 = "555"; num = Integer.parseint(st 1) + 5; a) A value-returning method b) A void variable c) A local variable d) A complex method Which of the following is not part of the method header? a) Return type b) Method name c) Parentheses d) semicolon Which of the following is always included in the method call a) Return type b) Method modifiers c) Parentheses d) Return variable Values stored in local variables a) Are lost between calls to the method in which they are declared b) Retain their values from the last call to the method in which they are c) May be referenced by the calling method d) May be referenced by any other method, if the method in which the is a public methodExplanation / Answer
7) correct answer is option a) 18
8) correct answer is opriotn d) all of the above
since when we divide the large program in to subparts the code is more maintaineable and resuable
9) correct answer is option a) value returning method
since the syntax of parseInt is
10) correct answer is option c) parenthesis
11) correct answer is a) return type
12) correct answer is a) are lost between calls to the method in which they are declared
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.