#quick variable declaration question

1 messages · Page 1 of 1 (latest)

formal kestrelBOT
#

<@&987246399047479336> please have a look, thanks.

formal kestrelBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

merry marsh
#

Ya

dreamy fox
#

how would i do the condtion one

#

?

merry marsh
#

hitPoints is an integer

#

Ya looks fine

dreamy fox
#

for the constructors is this right?

#

or do i use "this" here

merry marsh
dreamy fox
#

where wld this go?

#

on the varible(left) side?

merry marsh
#

this.hitPoints
this.pokemonName
etc

#

U are assigning the right side of the equals sign into whatever is on the left side

#

Yep

dreamy fox
#

like this?

#

ty

merry marsh
#

Looks good

dreamy fox
#

how do i do the condition part tho

merry marsh
#

Its just a big if-else if statement to check the int condition variable

#

if (condition > x && condition < y) {
} else if (...) {
}

#

etc

dreamy fox
#

where wld i put that tho?

#

right under where I declare variables or a new method

#

that wld be used in the constructors

formal kestrelBOT
#

Closed the thread due to inactivity.

If your question was not resolved yet, feel free to just post a message to reopen it, or create a new thread. But try to improve the quality of your question to make it easier to help you 👍