ElaKiri Community
Downloads
Go Back   ElaKiri Community > General > Education
Reload this Page BIT 2d semiya..
Reply
 
Thread Tools Display Modes
(#11)
Old
cvgdude's Avatar
cvgdude cvgdude is offline
Senior Member
cvgdude will become famous soon enoughcvgdude will become famous soon enough
 
Posts: 169
Join Date: Jun 2008
07-23-2011, 08:45 AM

math me para exam
Reply With Quote
(#12)
Old
inranasingha's Avatar
inranasingha inranasingha is offline
Senior Member
inranasingha is a glorious beacon of lightinranasingha is a glorious beacon of lightinranasingha is a glorious beacon of lightinranasingha is a glorious beacon of lightinranasingha is a glorious beacon of lightinranasingha is a glorious beacon of lightinranasingha is a glorious beacon of lightinranasingha is a glorious beacon of lightinranasingha is a glorious beacon of lightinranasingha is a glorious beacon of lightinranasingha is a glorious beacon of light
 
Posts: 4,756
Join Date: Jan 2008
Location: රජයේ රෝහල
07-23-2011, 01:28 PM

Quote:
Originally Posted by Lalakajee View Post
converts the value 10000 to a string, which is a double(so 10000 becomes 10000.0) in this case it is "10000.0" and stores it in the variable str.
In the System.out.println statement an addition is performed. with a string and a float.
So it simply adds these two like this

and returns


Tx machanz
Reply With Quote
(#13)
Old
inranasingha's Avatar
inranasingha inranasingha is offline
Senior Member
inranasingha is a glorious beacon of lightinranasingha is a glorious beacon of lightinranasingha is a glorious beacon of lightinranasingha is a glorious beacon of lightinranasingha is a glorious beacon of lightinranasingha is a glorious beacon of lightinranasingha is a glorious beacon of lightinranasingha is a glorious beacon of lightinranasingha is a glorious beacon of lightinranasingha is a glorious beacon of lightinranasingha is a glorious beacon of light
 
Posts: 4,756
Join Date: Jan 2008
Location: රජයේ රෝහල
07-23-2011, 01:31 PM

Quote:
Originally Posted by Lalakajee View Post
String equals method returns true or false based on the two string which it compares, in this case, "Anuradhapura" & "Anuradhapura" which is same.
So the answer is true.
But if they use == the return value is false since the == checks whether it references to the same object (memory space) which is wrong.
When a String variable is declared it always create a new object(which is a String object).
String objects cannot be changed, they are immutable.
thuthi machan
Reply With Quote
(#14)
Old
NipunaDDDD's Avatar
NipunaDDDD NipunaDDDD is offline
Senior Member
NipunaDDDD has a spectacular aura aboutNipunaDDDD has a spectacular aura aboutNipunaDDDD has a spectacular aura about
 
Posts: 1,624
Join Date: Jan 2009
07-23-2011, 07:51 PM

Mamanam danna widiyata liyala repeat karanda inne ban.
Reply With Quote
(#15)
Old
helo256's Avatar
helo256 helo256 is offline
Senior Member
helo256 is on a distinguished road
 
Posts: 2,097
Join Date: Oct 2010
07-23-2011, 07:55 PM

meewath prashnada yakoo.. CS degree ekak karala balapalla ...
Reply With Quote
(#16)
Old
sheyan's Avatar
sheyan sheyan is offline
Senior Member
sheyan is an unknown quantity at this point
 
Posts: 3,177
Join Date: May 2006
Location: Wattala
Send a message via Yahoo to sheyan
hmm - 07-23-2011, 07:56 PM

math meda sare dbms and maths amarui .........
Reply With Quote
(#17)
Old
Leo_D's Avatar
Leo_D Leo_D is offline
Senior Member
Leo_D is a glorious beacon of lightLeo_D is a glorious beacon of lightLeo_D is a glorious beacon of lightLeo_D is a glorious beacon of lightLeo_D is a glorious beacon of lightLeo_D is a glorious beacon of lightLeo_D is a glorious beacon of lightLeo_D is a glorious beacon of lightLeo_D is a glorious beacon of lightLeo_D is a glorious beacon of lightLeo_D is a glorious beacon of light
 
Posts: 2,679
Join Date: Jan 2011
07-23-2011, 09:27 PM

public class test{
public static void main(String args[]){
boolean a=false;

System.out.println(a=a);
}
}

ai mekedi output eka false wenne?
Reply With Quote
(#18)
Old
New Folder's Avatar
New Folder New Folder is offline
Senior Member
New Folder is just really niceNew Folder is just really niceNew Folder is just really niceNew Folder is just really niceNew Folder is just really niceNew Folder is just really niceNew Folder is just really niceNew Folder is just really nice
 
Posts: 1,758
Join Date: Jun 2011
Location: Horana
Send a message via Skype™ to New Folder
07-23-2011, 09:31 PM

bump
Reply With Quote
(#19)
Old
inranasingha's Avatar
inranasingha inranasingha is offline
Senior Member
inranasingha is a glorious beacon of lightinranasingha is a glorious beacon of lightinranasingha is a glorious beacon of lightinranasingha is a glorious beacon of lightinranasingha is a glorious beacon of lightinranasingha is a glorious beacon of lightinranasingha is a glorious beacon of lightinranasingha is a glorious beacon of lightinranasingha is a glorious beacon of lightinranasingha is a glorious beacon of lightinranasingha is a glorious beacon of light
 
Posts: 4,756
Join Date: Jan 2008
Location: රජයේ රෝහල
07-23-2011, 09:40 PM

Quote:
Originally Posted by Leo_D View Post
public class test{
public static void main(String args[]){
boolean a=false;

System.out.println(a=a);
}
}

ai mekedi output eka false wenne?
= kiyanne assgnment oprator eka.
a=a;
left side eke thiyana eka variable eka...
right eke thiyana eke value eka a ta assgn karagannawa..
mulin declare karala thiyanawa..
eka false kiyala..
data type eka boolean
out put false..
== thibbanam equalda kiyala balala ehemanam true retun karanawa nethnam false..
a==a
oya daala balanna..
if any correction plz..
Reply With Quote
(#20)
Old
Leo_D's Avatar
Leo_D Leo_D is offline
Senior Member
Leo_D is a glorious beacon of lightLeo_D is a glorious beacon of lightLeo_D is a glorious beacon of lightLeo_D is a glorious beacon of lightLeo_D is a glorious beacon of lightLeo_D is a glorious beacon of lightLeo_D is a glorious beacon of lightLeo_D is a glorious beacon of lightLeo_D is a glorious beacon of lightLeo_D is a glorious beacon of lightLeo_D is a glorious beacon of light
 
Posts: 2,679
Join Date: Jan 2011
07-23-2011, 09:42 PM

thanks
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright © 2006 - 2011 ElaKiri™ Beta2.Evo vBulletin, vBa iBproArcade Subdreamer I-Magic MKv
Optimisation plugin by DBtech

Page generated in 0.07839 seconds with 6 queries