#new to jave

10 messages · Page 1 of 1 (latest)

pastel rampart
#
int 5x = 10;
String name = 'Emil';
float myFloat = 5.99;
``` getting syntax error i go to coding they told me to create a variable
safe pollenBOT
#

This post has been reserved for your question.

Hey @pastel rampart! Please use /close or the Close Post button above when your problem is solved. 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.

spiral meadow
#

you need to use double quotes for string

old pike
#

^ ' are for single characters to make a char, " make a string

#

and variable names cant have a digit as the first letter, since that conflicts with other syntax

cobalt spoke
#

And you can't assign a double to a float variable. Guys, there was an error on each line.
(To fix this one, just add an f at the end of 5.99f . Or, y'know, don't use floats. I guess they're fine for rendering calculations but in that case you'll probably not declare a myFloat variable.)

old pike
#

nevermind

#

wow