What is the output of the below Java program with an empty return statement? public class TestingMethods2{ void show() { System.out.println("SHOW Method.."); return; } public static void main() { TestingMethods2 t2 = new TestingMethods2(); t2.show(); }} *
A) SHOW Method..
B) No output
C) Compiler error
D) None
2) What is the output of the below Java program with a void method? public class TestingMethods3{ void show2() { System.out.println("SHOW Method 2"); } public static void main() { TestingMethods3 t3 = new TestingMethods3(); t3.show2(); }}
A) SHOW Method 2
B) No output
C) Compiler error
D) None
3) A local variable declared inside a method can not be used in expressions without initializing it first. (TRUE / FALSE). *
A) TRUE
B) FALSE
C) -
D) -
4) All Java methods must have a return type. (TRUE / FALSE)
A) TRUE
B) FALSE
C) -
D) -
5) Java method signature is a combination of ___. *
A) Return type
B) Method name
C) Argument List
D) B & C
6) In Java, a method name can not start with a ___.
A) number
B) # (pound)
C) - (hyphen)
D) All the above
7) In Java, a method name can start with ___.
A) Alphabet
B) Underscore
Answers
Answered by
0
Answer:
A number is the correct answer
Similar questions