+ 1
Why this code is not working??
12 Answers
+ 8
Unfortunately, the code playground doesn't support swing or any other GUI library. You can take the input using the Scanner class instead.
https://www.sololearn.com/learn/Java/2220/
+ 7
@MINALI: Edited the previous answer, have a look.
+ 6
@MINALI: You might have not updated the app to the latest version in that case.
+ 6
@Dev how is it that I can't find these lessons in the learn section
+ 6
These are from the Java course, they can now be shared anywhere. It came with the latest update FYI.
+ 5
@MINALI: For instance, here's what you should do to make it work:
import java.util.Scanner;
public class Program
{
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int x,y,z;
x = scanner.nextInt();
y = scanner.nextInt();
z=((x*x)+(y*y));
System.out.print(z);
}
}
+ 3
Your code couldn't be run I think
+ 3
So what should I do??
actually it doesn't support JOptionPane class as well
+ 3
Although Thank uhh @Dev
+ 3
@Dev Thank uhhh soooooo much đ
+ 2
@Dev Actually it's not opening, will u plzz send the code again!
+ 2
@Yerucham
exactly scanner topic isn't there