12.4 Set the int variable epicLevel equal to awesomeLevel multiplied by 2


#1


Not sure what I'm doing wrong here - would love some guidance.
https://www.codecademy.com/en/courses/learn-java/lessons/introduction-to-java/exercises/generalizations?action=resume


Generalizations.java:7: error: unclosed character literal
int epicLevel='awesomeLevel'*2;
^
Generalizations.java:7: error: unclosed character literal
int epicLevel='awesomeLevel'*2;
^
Generalizations.java:7: error: not a statement
int epicLevel='awesomeLevel'*2;
^
3 errors


Replace this line with your code.


#2

What is a character literal? What does it look like? How does that relate to what's in your code?

Try consulting a search engine with either the error message or looking up what a character literal is. Add the word java in the search query for context


#3

Here's my exact code:
public class Generalizations {
public static void main(String[] args) {

Maybe you'll be able to see my error if I provide the exact code I tried?

	boolean isComplete=true;
	int awesomeLevel=121;
	int epicLevel=='awesomeLevel'*2;		
	/*System.out.println(epicLevel);*/
	//Starting the last Java step!//

}

}


#4

I don't need to see it or even tell you what the problem is because the compiler is already doing both of those things. So what you need to do is to read the error message that is coming from the compiler.
If you don't understand it then that's fine, but then you will need to dig a bit deeper, such as by searching for that error message with a search engine.

You don't need me.


#5

Just now I completed this question .I'm also a learner here .
your code is
int epicLevel=='awesomeLevel'*2;
replace this with
int epicLevel = awesomeLevel * 2;
hope this will help you .


#6

That works! Thanks so much! :slight_smile:


#7

can you help with the final one dude


#8

not the one up above this one


#9

Hi This is the answer for all the Question .
// boolean isComplete = true;
int awesomeLevel = 121;
int epicLevel = awesomeLevel * 2;
Hope it will help you .Sorry for the late reply.


#10

I think there is a bag that doesn't let me pass when i delete the code to let the last one pass. HELP


#11

upper case "L" in "awesomeLevel"


#12

Hi what you are trying to say .


#13

help me with step 5/12


#14

i had the exact thing typed out but when I copied and pasted it worked? anyways thanks


#15

Thanks man you really helped me out turns out my problem was just the semicolons. Oh well, guess now ill be more observant.


#16

I'm getting an error of expected ';' at the end of the line. but I have used a semi colon. please help me. my code is int epiclevel==int awesomelevel*2;


#17

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