Coding

Public class main{
public static void main(String args[]){
int a[]=new int[5];//declaration and instantiation
a[0]=1;//initialization
a[1]=2;
a[2]=3;
a[3]=4;
a[4]=5;
//printing array
for(int x=0; x < a.length; x++)//length is the property of
array
System.out.println(a[x]);
}
}

class Testarray1{
public static void main(String args[]){
int a[]={1, 2, 3, 4, 5};//declaration,
instantiation and initialization
//printing array
for(int x = 0; x < a.length; x++)//length is
the property of array
System.out.println(a[x]);
}
}

Hi this two source code that I share with you guiz are array and looping ,

as you can see they are same element and index the elements are the 1,2,3,4,5 and the index are 0,1,2,3,4,

So I this case their defferences is the space the first source code that I share are separated the number and more space take then the second source code are in one close parentheses the number of elements i use int datatype cause I said in my previous blog int is for number then the for loop the value of are x is zero then less then variable a means the index and the elements in the inside of braket then if the number is less then 0 is true it will increment or let say add and as I said before too if false it will back the position po zero and it will not increment .
They are same output our 2program but in source code they are not the same

that's is for today's video tutorial
this my tutorial for who want to be a programmer or a developer soon and every day that you practice you will gain knowledge on how to program a game or software and website just think positive you will learn coding don't you know guiz a coding ng or programmer are high salary? well in other countries morethan 1000$ their salary
if you encounter a error in your code just look the number that the machine languages say and look at your program and understand it
soon I will show how to solve errors in programming

Ididt put here the output so you can know what is the result .well I say what will be the output .
1
2
3
4
5



0
0
0.000
2 comments
avatar

Congratulations @catleen! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

You have been a buzzy bee and published a post every day of the week.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Check out our last posts:

Hive Power Up Month Challenge 2022-12 - Winners List
Be ready for the first Hive Power Up Month of the year 2023!
Update For Regular Content Creators - New Yearly Author Badge
The Hive Gamification Proposal Renewal
Support the HiveBuzz project. Vote for our proposal!
0
0
0.000