static String saySomething (String name) { return "Hi, " + name; } static String saySomething (String name, int count) { String greeting = ""; for(int i = 0; i < count; i++) { greeting += "Welcome, " + name + "\n"; } } return greeting; Which of the following would need to be called to result in the output: Hi, Sophia C a.) b.) System.out.println(say Something ("Sophia", 1)); System.out.println(say Something (1,"Sophia"));

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter4: More Object Concepts
Section: Chapter Questions
Problem 7RQ
icon
Related questions
Question
0
Given the following methods:
static String saySomething (String name) {
return "Hi,
" + name;
}
}
static String saySomething (String name, int count) {
String greeting = "";
for(int i = 0; i < count; i++) {
greeting += "Welcome, " + name + "\n";
UNIT 2 CHALLENGE 2.3: Complex Methods
}
return greeting;
Hi, Sophia
0
Which of the following would need to be called to result in the output:
a.)
b.)
System.out.println(say Something ("Sophia",1));
System.out.println(say Something (1, "Sophia"));
1
ap
2
Ov
!!!
9
In t
less
E
1. Ov
It is usef
numbers
version c
or types
method's
return typ
Transcribed Image Text:0 Given the following methods: static String saySomething (String name) { return "Hi, " + name; } } static String saySomething (String name, int count) { String greeting = ""; for(int i = 0; i < count; i++) { greeting += "Welcome, " + name + "\n"; UNIT 2 CHALLENGE 2.3: Complex Methods } return greeting; Hi, Sophia 0 Which of the following would need to be called to result in the output: a.) b.) System.out.println(say Something ("Sophia",1)); System.out.println(say Something (1, "Sophia")); 1 ap 2 Ov !!! 9 In t less E 1. Ov It is usef numbers version c or types method's return typ
Which of the following would need to be called to result in the output:
Hi, Sophia
a.)
b.)
UNIT 2 CHALLENGE 2.3: Complex Methe
K
System.out.println(say Something ("Sophia",1));
System.out.println(say Something (1,"Sophia"));
d.)
System.out.println(saySomething ("Sophia"));
System.out.println(say Something ("Hi Sophia"));
SUBMIT MY ANSWER
1.
It i:
nu
ver
or t
met
retu
Transcribed Image Text:Which of the following would need to be called to result in the output: Hi, Sophia a.) b.) UNIT 2 CHALLENGE 2.3: Complex Methe K System.out.println(say Something ("Sophia",1)); System.out.println(say Something (1,"Sophia")); d.) System.out.println(saySomething ("Sophia")); System.out.println(say Something ("Hi Sophia")); SUBMIT MY ANSWER 1. It i: nu ver or t met retu
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Concept of pointer parameter
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage