Jump to content

Recommended Posts

Posted

[quote name='soulmate' timestamp='1344042148' post='1302254832']
emaindi mama..
[/quote]
C# esthavendhi sSa_j@il

  • 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='1344041997' post='1302254822']
bhayya nuvu ichina code lo u declared num1 =100 and num2 =50 in main method ila kakunda how pass arguments I mean run time lo num1= ?

and num2 =? suppose two different numbers isthe add and subtract methods invoke ayyettu... amayakudu mama cheppindhi cheyyala type casting? sCo_^Y
[/quote]

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

Posted

old id em ayindhi..
nenu rasindhaniki reply ledhu kani...
[quote name='hava' timestamp='1344042137' post='1302254831']
yeah its me sSc_hidingsofa please clear my above mentioned doubt
[/quote]

Posted

[quote name='hava' timestamp='1344042221' post='1302254836']
C# esthavendhi sSa_j@il
[/quote]
cheppega mama naaku java raadu ani... antaa okale untadi syntax maarutadi ante

paina java syntax ese choodu..

Posted

[quote name='soulmate' timestamp='1344042267' post='1302254841']
Scanner in = new Scanner(System.in);
int num = in.nextInt();
[/quote]
endhi mama ila edho oka method use chyyalsindhe na? sCo_^Y can we do this by equals() method too? sCo_^Y

Posted

[quote name='ChampakDas' timestamp='1344042293' post='1302254842']
old id em ayindhi..
nenu rasindhaniki reply ledhu kani...
[/quote]
soodale mama soosei ostha aagu

Posted

basic structure ani okate..
[quote name='hava' timestamp='1344042221' post='1302254836']
C# esthavendhi sSa_j@il
[/quote]

Posted

[quote name='hava' timestamp='1344042328' post='1302254844']
endhi mama ila edho oka method use chyyalsindhe na? sCo_^Y can we do this by equals() method too? sCo_^Y
[/quote]
java naaku asalu pedda idea ledu mama.. c++ or c# sorry

Posted

[quote name='hava' timestamp='1344041997' post='1302254822']
bhayya nuvu ichina code lo u declared num1 =100 and num2 =50 in main method ila kakunda how pass arguments I mean run time lo num1= ?

and num2 =? suppose two different numbers isthe add and subtract methods invoke ayyettu... amayakudu mama cheppindhi cheyyala type casting? sCo_^Y
[/quote]

either u can type case or inka simple i will tell

Arguemts are of Sting type

means even if u give 10 as arg 1 it will consider as String r(remeber main method u mentioned as String[] args) ani ofcouse every one has to do no option

now

see what i will do

int num1 = -1 ;

try{

num1 = Integer.parseInt(args[1]) ; ///nee argument ikkkad pedithe what it will do is it will convert into int if the value is other than int it will throw below error
}catch(NumberFormatException e)
{
Sustem.out.println("Given value is not a type of int");
}

Posted

[quote name='ChampakDas' timestamp='1344041074' post='1302254759']
aasan bhasha mein..
Operations ante oka class which defines what it is..ante for example ee afdb undhi kada daniki profile name, number of posts, no of warnings etc etc define chesi unnayi...

Now 'o' is an object..nuvu rasina line meaning: instantiating an object antaru...so nuvu 'o' anne object define chesav..
now I can use that object 'o' to define a new member like o.profilename='Hava', o.posts=0...ala annamata..if you want to add more properties pina class definition marusthav anthey...
[/quote]
oh... ala class lo marchina properties anni manam object ki create cheskunna instance tho represent cheskovochu anamaata anthe na mama... example if i want to add quality poster property to hava.. o.qualityposter='Hava' ala anamaata :)

Posted

[quote name='cherlapalli_jailer' timestamp='1344042490' post='1302254853']
either u can type case or inka simple i will tell

Arguemts are of Sting type

means even if u give 10 as arg 1 it will consider as String r(remeber main method u mentioned as String[] args) ani ofcouse every one has to do no option

now

see what i will do

int num1 = -1 ;

try{

num1 = Integer.parseInt(args[1]) ; ///nee argument ikkkad pedithe what it will do is it will convert into int if the value is other than int it will throw below error
}catch(NumberFormatException e)
{
Sustem.out.println("Given value is not a type of int");
}
[/quote]
ok ok ok ok mama ippudu na test case lo ela raayamantaav code last ga oka code ivvu mama.. so that command line use chestuhunnapudu...num1 enter the number ani next enter numer two ani..so ala vere vere numbers isthunte sum is xxx and difference is xxx ani ala raavalani mama

Posted

[quote name='soulmate' timestamp='1344042462' post='1302254850']
java naaku asalu pedda idea ledu mama.. c++ or c# sorry
[/quote]
its ok mama thank you

Posted

[quote name='ChampakDas' timestamp='1344042354' post='1302254847']
basic structure ani okate..
[/quote]
payina oka doubt adiga cheppu mama :(

Posted

package operations;

public class CalcTest {


Functions f = new Functions() ;
int num1 = 100 ;
int num2 = 50 ;
System.out.println("Sum is "+f.add(num1, num2));
System.out.println("Difference is "+f.sub(num1, num2));

}

}


[size=7]ee code ichinappudu automatically 100+50 and 100-50 results ochesthunnayi... ila kakunda num1= ? and num2 =? ani adigela raavali mama[/size]

×
×
  • Create New...