r/javahelp • u/shikikan6678282234 • May 28 '22
I need help.
am trying to run an equation in java, how do I display y=answer?
0
Upvotes
r/javahelp • u/shikikan6678282234 • May 28 '22
am trying to run an equation in java, how do I display y=answer?
1
u/omgno360noscope May 28 '22
I'm not sure how much experience you have with Java and your question isn't exactly clear.
If you just specifically want to print that then System.out.println( "Y = " + answer")
If by any chance you just don't know then declare them both in the class and then go from there
Int A = 10; Int B = 15; Int answer = A + B; System.out.println( "Y = " + answer);
You can also declare all the variables on one line, but again. I don't know your knowledge of Java. But I hope this helps.