10.9k views
5 votes
Write a method, makeSubjectLine, that gets a String argument and returns the same String but with "Subject: " in front of it. So if the argument is "Are you going to the show?" the method returns "Subject: Are you going to the show?".

User Kasiriveni
by
6.1k points

1 Answer

6 votes

Answer:

public class newass {

/*

Write a method, makeSubjectLine, that gets a String argument and returns the same String but with "Subject: " in front

of it. So if the argument is "Are you going to the show?" the method returns "Subject: Are you going to the show?".

*/

public static void main(String[] args) {

System.out.println(makeSubjectLine("Are you going to the show?"));

}

public static String makeSubjectLine(String subj){

return "Subject: "+subj;

}

}

Step-by-step explanation:

The solution in Java Programming Language

User Delwinn
by
6.1k points