Jump to content

Recommended Posts

Posted

[quote name='hava' timestamp='1344042997' post='1302254862']
package operations;

public class CalcTest {


Functions f = new Functions() ;

Scanner in = new Scanner(System.in);
int num1 = in.nextInt();

Scanner in = new Scanner(System.in);
int num2 = in.nextInt();
System.out.println("Sum is "+f.add(num1, num2));
System.out.println("Difference is "+f.sub(num1, num2));

}

}


ee code ichinappudu automatically 100+50 and 100-50 results ochesthunnayi... ila kakunda num1= ? and num2 =? ani adigela raavali mama
[/quote]
paina quote lo maarchenu.. adi try chesi choodu..

  • Replies 103
  • Created
  • Last Reply

Top Posters In This Topic

  • hava

    44

  • cherlapalli_jailer

    17

  • soulmate

    11

  • Aamayakudu

    7

Top Posters In This Topic

Posted

[quote name='hava' timestamp='1344043077' post='1302254865']
idhe na final question please cheppesi vellandi please :)
[/quote]
package operations;

public class CalcTest {


Functions f = new Functions() ;

System.out.println("enter first number");

int num1 = Integer.parseInt(System.console().readLine());

System.out.println("enter second number");

int num2 = Integer.parseInt(System.console().readLine());

System.out.println("Sum is "+f.add(num1, num2));

System.out.println("Difference is "+f.sub(num1, num2));

}

}

idhi kooda oka saari try chey

Posted

[color=#282828][font=helvetica, arial, sans-serif][size=3][background=rgb(247, 247, 247)]Scanner in = new Scanner(System.in);[/background][/size][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][size=3][background=rgb(247, 247, 247)]int num1 = in.nextInt();[/background][/size][/font][/color]

[color=#282828][font=helvetica, arial, sans-serif][size=3][background=rgb(247, 247, 247)]Scanner in = new Scanner(System.in);[/background][/size][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][size=3][background=rgb(247, 247, 247)]int num2 = in.nextInt();[/background][/size][/font][/color]
[size=7][color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]Duplicate local variable mama [/background][/font][/color][/size]

Posted

[quote name='soulmate' timestamp='1344043412' post='1302254875']
package operations;

public class CalcTest {


Functions f = new Functions() ;

System.out.println("enter first number");

int num1 = Integer.parseInt(System.console().readLine());

System.out.println("enter second number");

int num2 = Integer.parseInt(System.console().readLine());

System.out.println("Sum is "+f.add(num1, num2));

System.out.println("Difference is "+f.sub(num1, num2));

}

}

idhi kooda oka saari try chey
[/quote]
Null pointer exception #/{-

Posted

[quote name='hava' timestamp='1344043477' post='1302254876']
[color=#282828][font=helvetica, arial, sans-serif][size=3][background=rgb(247, 247, 247)]Scanner in = new Scanner(System.in);[/background][/size][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][size=3][background=rgb(247, 247, 247)]int num1 = in.nextInt();[/background][/size][/font][/color]

[b][color=#282828][font=helvetica, arial, sans-serif][size=3][background=rgb(247, 247, 247)]Scanner in = new Scanner(System.in); //[/background][/size][/font][/color][/b][background=rgb(247, 247, 247)]Scanner in2 = new Scanner(System.in);[/background]

[color=#282828][font=helvetica, arial, sans-serif][size=3][background=rgb(247, 247, 247)]int num2 = in.nextInt();[/background][/size][/font][/color][size=7][color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)] [/background][/font][/color][/size]
[/quote]

"in" ne "in2" gaa marchi try chey..

paina inkoti chese adi try cheseva..

Posted

[quote name='hava' timestamp='1344043715' post='1302254886']
Null pointer exception #/{-
[/quote]
debug chey.... exception correct gaa ee line daggara vastundi..

Posted

package operations;

public class CalcTest {


Functions f = new Functions() ;

System.out.println("enter first number");


BufferedReader bufferRead1 = new BufferedReader(new InputStreamReader(System.in));
input num1 = bufferRead1.readLine();

System.out.println("enter second number");


BufferedReader bufferRead2 = new BufferedReader(new InputStreamReader(System.in));
int num2 = bufferRead2.readLine();

System.out.println("Sum is "+f.add(num1, num2));

System.out.println("Difference is "+f.sub(num1, num2));

}

}

idhinka laast.... try chey...

Posted
sSa_j@il sSa_j@il [quote name='soulmate' timestamp='1344044101' post='1302254913']
package operations;

public class CalcTest {


Functions f = new Functions() ;

System.out.println("enter first number");


BufferedReader bufferRead1 = new BufferedReader(new InputStreamReader(System.in));
input num1 = bufferRead1.readLine();

System.out.println("enter second number");


BufferedReader bufferRead2 = new BufferedReader(new InputStreamReader(System.in));
int num2 = bufferRead2.readLine();

System.out.println("Sum is "+f.add(num1, num2));

System.out.println("Difference is "+f.sub(num1, num2));

}

}

idhinka laast.... try chey...
[/quote]
Posted

Thak You Guys a Lot (.L@ (.L@ i luv u all thanks a lot for u responses and valuable time :4_12_13: :4_12_13:

Posted

[quote name='hava' timestamp='1344044689' post='1302254958']
sSa_j@il sSa_j@il
[/quote]
idhi kooda work avaledaa??

Posted

[quote name='soulmate' timestamp='1344044830' post='1302254968']
idhi kooda work avaledaa??
[/quote]
no mama few exceptions unnayi.. but all these input buffer anni chosthunte naaku koncham complicated ga undhi code... thanx for the help

Posted

If you are using eclipse you can pass the arguments by right clicking the project

RUN + Arguments tab and enter arguments giving a space

eX: num1 num2 ( Can be input/output files as well if you are parsing with excel or txt etc)

I haven't read all the posts but this is the answer if this is what you are looking for :)

Posted

[quote name='trust_212' timestamp='1344052095' post='1302255299']
If you are using eclipse you can pass the arguments by right clicking the project

RUN + Arguments tab and enter arguments giving a space

eX: num1 num2 ( Can be input/output files as well if you are parsing with excel or txt etc)

I haven't read all the posts but this is the answer if this is what you are looking for :)
[/quote]
This answer is useful and makes things easy I guess thanks for the post :)

Posted

[quote name='hava' timestamp='1344052298' post='1302255302']
This answer is useful and makes things easy I guess thanks for the post :)
[/quote]

Good Try it...If you need further help..let me know :)

×
×
  • Create New...