+ 1

Why the result of this Java code is no output ??

Java code 👇 https://code.sololearn.com/cwgBzXsPmMfs/?ref=app

8th Feb 2021, 9:14 AM
Carbon dioxide
Carbon dioxide - avatar
6 ответов
+ 5
Here not present main function. And you didn't call the function. Every Java program starts Execute from main function
8th Feb 2021, 9:18 AM
Vadivelan
+ 2
Vadivelan Atul get now error... import java.util.Scanner; public class BankAccount { private double balance=0; Scanner balance = new Scanner(System.in); System.out.println(BankAccount.nextLine()); public void deposit(double x) { if(x > 0) { balance += x; System.out.println(balance); } else if(x < 1) { balance -= x; System.out.println(balance); } else { System.out.println(x); } } }
8th Feb 2021, 10:48 AM
Carbon dioxide
Carbon dioxide - avatar
+ 2
Jeff's JK (HTML challenger and the coders 💻)🇮🇩 I think, you should Go through the Java course.
8th Feb 2021, 10:59 AM
Vadivelan
+ 1
Bro use Scanner input for it
8th Feb 2021, 9:19 AM
Atul [Inactive]
+ 1
If you want your Java program to do something when it is compiled, there should be "public staic void main (String [])" function, in which code to execute is written.
8th Feb 2021, 9:20 AM
#0009e7 [get]
#0009e7 [get] - avatar
+ 1
Ok...
8th Feb 2021, 10:32 AM
Carbon dioxide
Carbon dioxide - avatar