#Attempting a count down

20 messages · Page 1 of 1 (latest)

long mantle
#

Im trying to make a countdown, but its not working for me. If i try to have public static void countdown(int n) { with out main(string) the program still asks for string

tender pastureBOT
#

This post has been reserved for your question.

Hey @long mantle! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

dapper token
#

you're trying to declare a method inside another method

#

pay attention to your brackets

long mantle
#

the program still asks for it

dapper token
#

you still need a main

#

it's the entry point

#

but you can't have methods inside methods

#

methods can only be inside types (classes, interfaces, enums, records)

long mantle
#

ah

#

so how would i input countdown or maybe even count up within my program?

dapper token
#

uh you already have?

#

(although be careful, your method's going to break with a negative number)

long mantle
#

ah ok

dapper token
#

oh input, sorry i read that as implement

#

as mentioned before, main is the entry point to the program
java calls that for you
anything else you want to do, you need to do from main

long mantle
#

ah ok thanks