i have just printed s here in the called method & its verified too.
it looks like i m missing some point here which they are explaining
what exactly codegym is trying to explain here ?
Under discussion
Comments (6)
- Popular
- New
- Old
You must be signed in to leave a comment
Sarvesh
6 January 2019, 07:15
Can anyone help me find the mistake with below code.
Error I was getting was :
com/codegym/task/task03/task0302/Solution.java:13: error: invalid method declaration; return type required
public static printString(String s);{
0
Sarvesh
6 January 2019, 07:15
package com.codegym.task.task03.task0302;
/*
Display right away
*/
public class Solution {
// write your code here
public static void main(String[] args) {
printString("Hello, Amigo!");
}
public static void printString(String s);{
System.out.println("s");
}
}
+1
parth shah
1 December 2018, 18:08
package com.codegym.task.task03.task0302;
/*
Display right away
*/
public class Solution {
// write your code here
public static void printString(String s)
{
System.out.println(s);
}
public static void main(String[] args) {
printString("Hello, Amigo!");
}
}
+2
Michael Martin
1 December 2018, 19:24useful
They just want you to practice creating a method with a parameter and using that method.
+3
Thomas
20 May 2019, 23:52
Shah / Michael --- Further clarification : Seems like it doesn't matter if main ( ) is placed after new method printString ( ) in code structure ?? Is this like Hoisting in Javascript )) lol
![]()

0
Michael Martin
1 December 2018, 17:57
Can you show your code?
+1