Level 4. Data Types |||: char


#1

I don't understand what to do.

instruction:1.In between the parentheses of System.out.println(); type any single character of your choice. Make sure it's enclosed in single quotes!

and i have this :
public class DataTypesC {
public static void main(String[] args) {

      System.out.println ();

}

}

what i have to do.


#2

I am stuck as well. Need help on this stage! Give the example please! Thank you!


#3

I'm having some trouble knowing which part of those instructions that you are having doubts about.

Do you see the System.out.println() in the editior?
Do you see the parentheses?
Maybe you don't know what is meant by a character?
Or is it the part about the single quotes, maybe your keyboard doesn't have those?

Just take it one step at a time!


#4

in Java there are several data types like doubles , strings, chars, ints, lists
Now chars in Java are treated as integers but what really separates them from strings is how they are written. For example

// a typical string variable will be declared like this
// notice below that i surround it in double quotes
String random = "codeacademy";

//but to declare a char on the other hand can be done like this
// notice below that i surround it in single quotes
char random = 's';

//Now the question wants you to  just print out any char
System.out.println('k');

I know this is sort of a brief explanation but hope it helped?


#5

OMG my mistake comes from the double quotes , how stupid ....
IT'S SHOWN 'G' and I inexplicably write "G"
' ' :smile: " "
Thank you!