❔ i am trying to combine methods with public static void main and its faling horibly
.
7 Replies
public static void main(int age, int hours, int c = 0)
whats wrong about it
"a name space cannot directley contain members such as fields or methods "
Show all of your code
Although it seems the error is quite self-explanatory
$codegif
public class Program
{
public static bool check(int age)
{
if (age <= 18 && age >= 15)
{
return true;
}
else
{
return false;
}
}
}
public static void main(int age, int hours, int c = 0)
{ } } sorry for the late response i just thought i should be abele to use both of them in the same program otherwise whats the point in using bool
{ } } sorry for the late response i just thought i should be abele to use both of them in the same program otherwise whats the point in using bool
So, let's clean up the code a little
Do you see the issue?
i guss i miscaculated
thenk you for the help
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.