We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 431c268 commit b1290c8Copy full SHA for b1290c8
Classes/Fields2Class/MyAwesomProgram.java
@@ -31,3 +31,21 @@ public static void main(String [] args)
31
//Bob Smith
32
}
33
34
+
35
+//<-------------CHANGING THE ABOVE CODE TO THE BOTTOM CODE TO CALL THE OUTPUT METHOD ON USER FROM A STRING VARIABLE!------------->
36
+public class MyAwesomeProgram
37
+{
38
+ public static void main(String [] args)
39
+ {
40
+ User user = new User();
41
+ user.firstName= "Bob";
42
+ user.lastName= "Smith";
43
44
+ String message = user.output();
45
46
+ System.out.println(message);
47
48
+ }
49
+}
50
+//Remember whenever I have the keyword void within my method declaration
51
+//I can still use the return keyword within it but I cannot return a value.
0 commit comments