+ 3
Java error.. Pls help me
2 odpowiedzi
+ 17
Here is the valid code. I edited getdata() method.
import java.io.*;
import java.util.*;
class help
{
int ac,b,c;
void getdata()
{
Scanner a= new Scanner(System.in);
System.out.println("enter the value of a:");
ac=Integer.parseInt(a.nextLine());
System.out.println("enter the value of b:");
b=Integer.parseInt(a.nextLine());
}
void putdata()
{
c=ac+b;
System.out.println("first number="+ac);
System.out.println("second number="+b);
System.out.println("addition="+c);
}
}
class next
{
public static void main(String args[])
{
help op = new help();
op.getdata();
op.putdata();
}
}
+ 5
Wow many errors... 🤔😨😤👿