Java 1.5 says wrong but looks fine


#1

well im new to Java and here is the my problem it wants me to do these:
1.
Set the int variable myNumber equal to the value 42.
2.
Set the boolean variable isFun equal to true.
3.
Set the char variable movieRating equal to 'A'.

and here is what im trying to do:

public class DataTypesC {
public static void main(String[] args) {

	
	int myNumber = 42;
	boolean isFun = true ;
            char movieRating = 'A';

}

}

i dont get it i also know C but cant figure out why this is wrong


#2

@chipace47124,
Try it with

public class Variables {
	public static void main(String[] args) {

		int myNumber = 42;
		boolean isFun = true; 
		char movieRating = 'A'; 

	}
}

https://docs.oracle.com/javase/tutorial/java/javaOO/classdecl.html
https://docs.oracle.com/javase/tutorial/java/javaOO/variables.html
https://docs.oracle.com/javase/tutorial/java/javaOO/methods.html
https://docs.oracle.com/javase/tutorial/java/javaOO/constructors.html
https://docs.oracle.com/javase/tutorial/java/javaOO/arguments.html
https://docs.oracle.com/javase/tutorial/java/javaOO/objectcreation.html
https://docs.oracle.com/javase/tutorial/java/javaOO/usingobject.html
https://docs.oracle.com/javase/tutorial/getStarted/application/


#3

whats the difference ?
im checking the link thank you very much for them


#4

tried with your c ode it didnt work again


#5

@chipace47124,
Please provide the code you are really using.....


#6

this

public class DataTypesC { public static void main(String[] args) {


int myNumber = 42;
boolean isFun = true ;
        char movieRating = 'A';

}

}


#7

@chipace47124,
Why are you using the Class-name DataTypesC
when the course-checker is expecting Variable as Class-name


#8

Because question gives that part itsellf so i didnt changed it even if i change it still gives same error


#9

There is/was a bug where the editor wasn't changing file when you switched exercise. The file should be DataTypesC.java

Refreshing the page seems to work for others. Someone who might or might not be an engineer also says it's fixed now


#10

yeah its fine now thank you all guys