The Java Beginners Discussion And A Like - PINOYDEN


Go Back   PINOYDEN > PC Zone > Programming

Welcome to PinoyDen Forums.

You are currently browsing our forum as a guest, please consider registering to get full access to all of our forum features, download free games, get help for your pc and cellphone problems and learn new mobile tricks like how to browse the internet using your cellphone for free. All that and more, so what are you waiting for, JOIN us now!!!! Click here to register...
 Topic: The Java Beginners Discussion And A Like  (Read 2605 times)
0 Members and 1 Guest are viewing this topic.
Pages: 1 2 3 [4] 5 6   Go Down
Reply #45
08-25-12 01:56 AM
  • Full Member
  • ***
  • Offline
 
Posts: 806
Thank You: 25
Reputation: 0
nickle27 has no influence.barely matters.is working their way up.might someday be someone...is on the verge of being accepted.is a rising star!has a powerful will.is a force to reckon with.has great potential!has an aura about them.is leading the good life!is awe-inspiring!
pa subscribe
Reply #46
08-25-12 08:51 AM
  • Full Member
  • ***
  • Male Offline
 
Posts: 1331
Thank You: 346
Reputation: 1
m1ndfr3ak has no influence.barely matters.is working their way up.might someday be someone...is on the verge of being accepted.is a rising star!has a powerful will.is a force to reckon with.has great potential!has an aura about them.is leading the good life!is awe-inspiring!
Pasubscribe ako dito ts
Reply #47
08-27-12 02:44 AM
  • Full Member
  • ***
  • Male Online
 
Posts: 1427
Thank You: 81
Reputation: 1
mr_itou has no influence.barely matters.is working their way up.might someday be someone...is on the verge of being accepted.is a rising star!has a powerful will.is a force to reckon with.has great potential!has an aura about them.is leading the good life!is awe-inspiring!
TS, panu ilabas yung sum ng first 250 prime numbers?
Like this.
Quote:
The prime no.
2
3
5
7
.
.
.

Reply #48
09-01-12 11:56 PM
  • Full Member
  • ***
  • Male Offline
 
Posts: 2815
Thank You: 230
Reputation: 2
mikesilver has no influence.barely matters.is working their way up.might someday be someone...is on the verge of being accepted.is a rising star!has a powerful will.is a force to reckon with.has great potential!has an aura about them.is leading the good life!is awe-inspiring!
Netbeans naman gamit namin..Hehe may shortcut kasi sa gui development..
@sa taas
heto lang po logic jan:
Code: [Select]
int sum=0,x=0,y=1;
for(int a=0;a<250;a++)
{
sum=(x++)+(y++);
cout<<sum<<endl;
x=y;
y=sum;
}
Reply #49
09-02-12 08:38 AM
  • Full Member
  • ***
  • Male Online
 
Posts: 1427
Thank You: 81
Reputation: 1
mr_itou has no influence.barely matters.is working their way up.might someday be someone...is on the verge of being accepted.is a rising star!has a powerful will.is a force to reckon with.has great potential!has an aura about them.is leading the good life!is awe-inspiring!
Quote:
Originally Posted by : mikesilver on 09-01-12 11:56 PM
Netbeans naman gamit namin..Hehe may shortcut kasi sa gui development..
@sa taas
heto lang po logic jan:
Code: [Select]
int sum=0,x=0,y=1;
for(int a=0;a<250;a++)
{
sum=(x++)+(y++);
cout<<sum<<endl;
x=y;
y=sum;
}

di ko magets..
pakiexplain po..

panu naman po 'pag gusto ko hanapin yung may 15 digits na numbers.
ex. hanapin ko yung may 15 digit na fibonacci number..
panu source code nun?
Reply #50
09-02-12 11:26 AM
  • Semi-Newbie
  • *
  • Female Offline
 
Posts: 49
Thank You: 1
Reputation: 0
ambisyossa has no influence.barely matters.is working their way up.might someday be someone...is on the verge of being accepted.is a rising star!has a powerful will.is a force to reckon with.has great potential!has an aura about them.is leading the good life!is awe-inspiring!
pa-subscribe din
Reply #51
09-02-12 05:02 PM
  • Jr. Member
  • **
  • Offline
 
Posts: 101
Thank You: 5
Reputation: 0
itzZmeMraL has no influence.barely matters.is working their way up.might someday be someone...is on the verge of being accepted.is a rising star!has a powerful will.is a force to reckon with.has great potential!has an aura about them.is leading the good life!is awe-inspiring!
sir pwede pa help sa project ko! Eto po! Paano po hindi mauulit yung mga word?
Reply #52
09-07-12 01:12 AM
  • Full Member
  • ***
  • Male Offline
 
Posts: 2815
Thank You: 230
Reputation: 2
mikesilver has no influence.barely matters.is working their way up.might someday be someone...is on the verge of being accepted.is a rising star!has a powerful will.is a force to reckon with.has great potential!has an aura about them.is leading the good life!is awe-inspiring!
Nahirapan ako dito sa java. Sa gui,lalo na wala pang pc..Wew
Reply #53
09-07-12 08:29 PM
  • Semi-Newbie
  • *
  • Offline
 
Posts: 11
Thank You: 0
Reputation: 0
bsimene has no influence.barely matters.is working their way up.might someday be someone...is on the verge of being accepted.is a rising star!has a powerful will.is a force to reckon with.has great potential!has an aura about them.is leading the good life!is awe-inspiring!
wow.. thanks sir. buti nakita ko tong thread na to. gusto ko gumawa o mag edit ng  mga java file
Reply #54
09-08-12 02:34 AM
  • Full Member
  • ***
  • Male Offline
 
Posts: 2815
Thank You: 230
Reputation: 2
mikesilver has no influence.barely matters.is working their way up.might someday be someone...is on the verge of being accepted.is a rising star!has a powerful will.is a force to reckon with.has great potential!has an aura about them.is leading the good life!is awe-inspiring!
Quote:
Originally Posted by : mr_itou on 09-02-12 08:38 AM
di ko magets..
pakiexplain po..

panu naman po 'pag gusto ko hanapin yung may 15 digits na numbers.
ex. hanapin ko yung may 15 digit na fibonacci number..
panu source code nun?
ididisplay nya po lahat ng fibonacci series of numbers below 250.. Kung 15 numbers lang po ganito po siya:
Code: [Select]
int x=0,y=1,sum;

for(int z=0;z<15;z++)
{
cout<<sum=(x++)+(y++)<<"\t";
x=y;
y=sum;
}
Reply #55
01-03-13 04:13 PM
  • Full Member
  • ***
  • Offline
 
Posts: 2714
Thank You: 144
Reputation: 0
dodong143 has no influence.barely matters.is working their way up.might someday be someone...is on the verge of being accepted.is a rising star!has a powerful will.is a force to reckon with.has great potential!has an aura about them.is leading the good life!is awe-inspiring!
thanks dito i got it !,
 well done tut.
Reply #56
01-04-13 05:48 PM
  • Semi-Newbie
  • *
  • Offline
 
Posts: 26
Thank You: 0
Reputation: 0
drym has no influence.barely matters.is working their way up.might someday be someone...is on the verge of being accepted.is a rising star!has a powerful will.is a force to reckon with.has great potential!has an aura about them.is leading the good life!is awe-inspiring!
Sana makarating sa mga functions  ang topic...
Reply #57
01-06-13 09:31 PM
  • Jr. Member
  • **
  • Offline
 
Posts: 166
Thank You: 2
Reputation: 0
gibsonslasher22 has no influence.barely matters.is working their way up.might someday be someone...is on the verge of being accepted.is a rising star!has a powerful will.is a force to reckon with.has great potential!has an aura about them.is leading the good life!is awe-inspiring!
Sir saan pwede makahanap ng magagandang look and feel. Thanks.
Reply #58
01-07-13 12:39 PM
  • Full Member
  • ***
  • Offline
 
Posts: 902
Thank You: 147
Reputation: 0
Dyoll has no influence.barely matters.is working their way up.might someday be someone...is on the verge of being accepted.is a rising star!has a powerful will.is a force to reckon with.has great potential!has an aura about them.is leading the good life!is awe-inspiring!
sir pwedi po ito sa win7 32bit gusto ko rin matuto ng programing kaso wala po akong idea.
Reply #59
03-26-13 08:13 AM
  • Jr. Member
  • **
  • Male Offline
 
Posts: 67
Thank You: 26
Reputation: 0
Funfun has no influence.barely matters.is working their way up.might someday be someone...is on the verge of being accepted.is a rising star!has a powerful will.is a force to reckon with.has great potential!has an aura about them.is leading the good life!is awe-inspiring!
Creating and using an Array

Example code to create an array of integer named nums with ten elements.
Code: [Select]
int[] nums = new int[10];or
Code: [Select]
int nums[] = new int[10];
Example code of intializing every element of nums array by 2:
Code: [Select]
nums[0] = 2;
nums[1] = 2;
nums[2] = 2;
nums[3] = 2;
nums[4] = 2;
nums[5] = 2;
nums[6] = 2;
nums[7] = 2;
nums[8] = 2;
nums[9] = 2;
Note that to initialize an array element you need to first type the array name which in this case nums and then followed by an open bracket. Then followed by a number from 0 up to array length minus 1, in this case the length of the array is 10 minus 1 is equal to 9. And then followed by a closing bracket, an equal sign and a value that you want put to the current array element.

If you know a looping statement like for loop you can also use that to initialize all elements of an array. For example:
Code: [Select]
for (int i=0; i<nums.length; i++) {
    nums[i] = 2;
}
Its worth noting that when using length attribute of an array, like in nums.length, it will return the exact length of array which in this case is 10.

Lastly to access an array elements value just do something like the code below:
Code: [Select]
nums[0];
nums[1];
nums[2];
nums[3];
nums[4];
nums[5];
nums[6];
nums[7];
nums[8];
nums[9];
but note that the code above will not print anything on the screen(console/command prompt). So insteand of doing that, just put that code inside System.out.println() just like this.
Code: [Select]
System.out.println(nums[0]);
System.out.println(nums[1]);
System.out.println(nums[2]);
System.out.println(nums[3]);
System.out.println(nums[4]);
System.out.println(nums[5]);
System.out.println(nums[6]);
System.out.println(nums[7]);
System.out.println(nums[8]);
System.out.println(nums[9]);
But if you know looping statement like for loop you can use that to lessen the code above. For example:
Code: [Select]
for (int i=0; i<nums.length; i++) {
    System.out.println(nums[i]);
}
Note that the code above produces the same result of the previous code with less typing. Always remember to write your code as shorter as possible. This will not only reduce your typing of code but also will makes your debugging much more easy.

Bonus:
Example code of adding values of of all elements.
Code: [Select]
int sum = nums[0] + nums[1] + nums[2] + nums[3] + nums[4] + nums[5] + nums[6] + nums[7] + nums[8] + nums[9];
But if you know looping statement like for loop you can rewrite the previous code like the following code below.
Code: [Select]
int sum = 0;

for (int i=0; i<nums.length; i++) {
    sum = sum + nums[i];
}
That's it we're done. I hope that you learn something from this tutorial.
Pages: 1 2 3 [4] 5 6   Go Up
 



All dates are GMT+8:00. The date now is 05-21-13 08:55 PM
WWW.PINOYDEN.COM.PH does not store any files on it's server, we are just indexing other sites contents!
WWW.PINOYDEN.COM.PH [Ang Tambayan ng pinoy!] © copyright 2008-2009 All Rights Reserved.
Contents published on www.PinoyDen.com.ph requires permission for reprint.

Page created in 0.183 seconds with 22 queries.