22nd Aug 2017, 4:21 PM
Sreejith P
Sreejith P - avatar
2 Antworten
+ 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(); } }
22nd Aug 2017, 4:31 PM
Igor Makarsky
Igor Makarsky - avatar
+ 5
Wow many errors... 🤔😨😤👿
22nd Aug 2017, 4:24 PM
<mr/>
<mr/> - avatar