It’s about array so what is an array in computer programming what I’m going to teach you is about array so it will still use data types so you learn Japanese data type but in some cases, a variable that is declared in an array is totally different from a normal variable to make a good example imagine this um um variable is a variable array or arrow variable is different computer programming array foreign it’s got a picture out now so i hope you want a picture out it’s just like a lunch box okay a normal variable is just like a lunch box with only one compartment solid while an array variable is like a lunchbox which has many division or compartments a solute okay another example but first let me open an excel okay ah one two three four five so let’s try to visualize an array so i hope you can see this okay so this one getting is rice okay now but this variable b is a yellow orange-yellow and red and blue okay.
So pudding on the green or grass and then hot dog and spikes and then some blue is egg fried egg, okay i just egg and then egatolo is soup, okay so that is the difference between normal variable and array variable in our lunchbox a rice load launch box so in an arrow variable although mon anyone presentation divided into four and actual implementation of the array so programming is so this is blue this is red and then i have yellow than the green so an actual programming uh implementation of our variable is so there top of each of those chains or uh part of the chain is so in computer programming and array and is an index so perhaps this is zero this is one this is two and this is three beginning number now let’s convert the term name into index initially zero one two and three indexes three that is egg so index deletion one it will start with zero by default.
It will only start with one if emotion specif uh specify but declare amongst yogurt one or index one but i doubt yeah there are programming languages that would uh allow you to do that usually it really starts with zero indexes and x0 and x1 and x2 index three foreign okay um so perhaps money um um chain right so this is index zero index one index two index three in ana auto convert into a chain we have four rings and that four rings and i say indexing zero one two and three okay so that indexes or nd says it could be fun we can also call that as a heater or address index 0 1 two and three not only now indexes but put into us but the purpose of that is we will create a simple program with java implementing a variable array okay so i public class void main okay foreign and then stream fools four times so, by the way, this is the declaration with uh predefined relent variable foods as a string array with four compartments or divisions or four indexes or indices okay.
The type string this is the symbol of array declaration bracket braces so yeah brackets are a variable declaration usually the data type that means this is how you um set the length of an array variable so the next line an excellent one-word food okay 0 1 okay error select the previous discussion my great dog path or link between the folder program we’re in the Mukesh java program to the java compiler file of java machine or the java development kit okay so let’s try part c program files java JD key and pin okay with this command we are now connected to the uh java development kit in our program files and drive c so at the same time okay so although what but r identifier public class void mainstream arcs an error and then abortion error okay scanner is equal to new scanner system that ends it’s supposed to be this is big s is hot dog be now how about i display absolutely h its lunchtime please choose is okay.
Select equals to sc dot next and since in the german again attorneys next and instead of next is for a series of characters like string a word patterning both look and entertain names of food so we didn’t next but in this case, 0123 tapos select okay so food first is rice next is i can’t memorize hot dog next is soup and then last one is egg so remember oops so i guess there’s something wrong with our um or let me try this one uh fresh error okay i have an error on java 19 well i don’t know how but I’m gonna see my colon and this is it i don’t know if you can still uh see clearly my code so there you don’t know any line 19 cool and called semicolon to save the program and then is to have this command java I am their food first rice chicken hot dog third soup last is egg again then hold up at my second number it’s lunch time please enter a number for your food as you can see in the series of uh the previous operation.
The indexer running rice index one and hot dog index two and soup and this index tree and egg now i want to shop so since billy on that index so hot dog then soap and then i have egg now there is hot dog this is supposed to be either zero or one or two or three but since dynamic and interaction between the program and the user so unanimous number one number static number instead of variable nasi ohm as you can see in this line number six meaning the romantic getting out for invalid although but index four is not existing kai zero montage so good zero one two three so three right until index out of bounds exception that means lumagpas cannot don’t limit the number because young limit the number line is from zero up to three since four languages is out of bounds exception out of bounds meaning neglect passes a boundary a three zero one two three okay four bromine an um okay less than three i plus so c4 for a loop about loop while do while for loop okay good.
Now suppose display and third foot now suppose displaying last food okay so additional information along for index i code less than three and value knee i dysplasia but number my solute index three should happen is a less than three less than it java so rice and fresh food hot dog and chicken food um the third one is soup and then this one is egg soda consumption for example there is a bose mangano it’s alone so i don’t know if you can still see my program alongside parts of four display all four displays line number 10 to line number 710 a display anymore and then the ray so next line is ask for edit change or update so another line i’m going to put just a user um variable foods and you see that next one two sorry so entered it please enter index number a new food so for example display all new foods first display change you can display okay rice so as you can see and next number to also tapos if my code is um right or good but it is plain but instead of soap and index number two try foreign is did again.
Get a hockey change then java so rice hotdog soup and egg so display if you want to edit it please enter index number so I’m going to number three if you want to eat it please enter new food eggs variable declaration in a daily array which is, for example, killing and select okay or string or car as you can see there are some decorations above about hosting it again data type at home variable foods and you have to type is other than a string like a blob of binary bits for example so is load is one two three four five six right the mishap with this woodland oh one point two three-point nine or economical words although the concept must hold of the same type remember that an array variable will accept two or more values of the same type again data type is string put an individual number automatically convert into for example 3.0 2.0 1.0 um array variable it displays indexer robust index one’s index two indexes three you know okay.
Movie