Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Puffin Rock Characters Plush Toy Set
anil1961
Updated:
43 minutes ago
Toyota Vitz scp10 For Sale
Lakmal Bandara
Updated:
Wednesday at 10:50 AM
Kandy
Welcome all my all new pet shop Bark.lk
dilumrane
Updated:
Monday at 12:26 PM
Windows RDP Only Rs.500 a month
Blogerwiki
Updated:
Sunday at 12:41 PM
Ad icon
V2ray VPN for Tunneling
hu KANNA
Updated:
Oct 22, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
Computers & Internet
Software Development
Java wala return keyword eken mokakda wenne
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="maleesha udan" data-source="post: 28617834" data-attributes="member: 570077"><p>public static int add(int n1,int n2){</p><p> return n1+n2;</p><p> }</p><p></p><p></p><p> public static void main(String[] args) {</p><p> </p><p> System.out.println(add(10,20));</p><p></p><p> }</p><p></p><p>output - 30</p><p></p><p></p><p><span style="font-size: 18px">return එකෙන් වෙන්නේ අපහු value එකක් return කරන එක.මේකෙදි main method එකේදී add කියන method එක call කරනකොට (add method එකේ parameter තියෙන නිසා argument pass කරන්න ඕනේ ) add method එකෙන් n1 + n2 return වෙනවා.method එකේ return type එක int නම් integer එකක් , boolean නම් true /false value එකක් , double නම් දශම සංක්යාවක්,char නම් character එකක් සහ String නම් string value එකක් return වෙනවා.</span></p><p><span style="font-size: 18px">අනිත් method /function වර්ගේ තමා void , void වලදී value එකක් return වෙන්නේ නෑ.</span></p></blockquote><p></p>
[QUOTE="maleesha udan, post: 28617834, member: 570077"] public static int add(int n1,int n2){ return n1+n2; } public static void main(String[] args) { System.out.println(add(10,20)); } output - 30 [SIZE=5]return එකෙන් වෙන්නේ අපහු value එකක් return කරන එක.මේකෙදි main method එකේදී add කියන method එක call කරනකොට (add method එකේ parameter තියෙන නිසා argument pass කරන්න ඕනේ ) add method එකෙන් n1 + n2 return වෙනවා.method එකේ return type එක int නම් integer එකක් , boolean නම් true /false value එකක් , double නම් දශම සංක්යාවක්,char නම් character එකක් සහ String නම් string value එකක් return වෙනවා. අනිත් method /function වර්ගේ තමා void , void වලදී value එකක් return වෙන්නේ නෑ.[/SIZE] [/QUOTE]
Insert quotes…
Verification
Awruddata maasa keeyada?
Post reply
Top
Bottom