Super basic question


#1

Just started Java 101 intro course

task #1 5/12 line five…

task
2. Set the boolean variable isFun equal to true.

What’s wrong with this line?

	boolean isFun (true);

#2

Programming languages have grammar, same as human languages. If you don’t use correct grammar then you aren’t making sense. What you should do in this situation is to consider what you meant to do, and then look up how it’s done if you’re not sure, either by using a search engine such as google or if you already know of some documentation where that information is available.

P.S. JavaScript and Java are two different languages.


#3

This is embarrassing.

I get the grammar - programming link and I did check back in the previous course tasks. I also exhaustively tried different alternatives, but unfortunately all to no avail.
I just assumed the necessary info would be incorporated in the course itself.

Google search it is…

Thanks and I also didn’t know that Java and JavaScript were different. LOL


#5

Hey, Reco

Thanks a helluva lot for that.

The previous example was
System.out.println(true);

The answer proved to be
boolean isFun = true;

What could be simpler than that?

I’m guessing that this is NOT a revelation to up to 90+% of the people in the forum. :laughing:

Right then… time for 6 / 12


#6

this is Java, you posted your question under JavaScript category on the forum. There is quit a difference, Java is to Javascript what ham is to hamster, there isn’t much of a relation between the two languages.

Reco code samples are Javascript examples. Your code samples seem to be Java.

These languages have different syntax, var is not used in Java


#7

Deleted as not javasript forum now lol.


#8

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.