Hello and welcome to the golems programming language course in this session, we want to talk about
lysis concept.
As slices and go golden.
In goal language, Aslan's is more powerful, flexible and convenient that NRA and is a lightweight
data structure.
This life is a variable length cyclase, which has those elements of a similar time.
You are not alone twists or different type of elements in the same slice.
It's just like an array having an index value and length.
But the size of this line is reassigned.
They are not in fixed size, just like an array.
Internally, Aslan's and array are connected with each other.
S-line is a reference to an underlying array.
It is a to assess or duplicate elements in this life.
The first index position in this slice is always zero, and the last one will be lengths of a slice
minus one.
As Liz points to an underlying area and is internally represented by a slice Heather Onli area the size
of their nice is flexible and can be changed internally.
A slice is represented by three teams.
First pointers.
Pointer to the underlying rate, second length content, length of the underlying eye and capacity.
Total capacity, which is the maximum capacity to which the underlying area can expand.
Declaration and initialization as slices as slice is declared just like an array.
But it doesn't contain the size of their slice, so it can grow or shrink according to the requirements.
We can define it slices in several different ways.
Create a slice using estimates these are create a slice using an array.
Create a slice using already existing gas lines and create a slice using match function.
Create this slice using a slice, literally, you can create a slice using this nicely, try the creation
of a nicely thrall is just like an R-rated run, but with one difference you are not allowed to specify.
The size of this lies in this score basis, as shown in the below example.
The right hand side of this equation is this nice little run that my slice is square break is a string
and initialize the value like gene game.
I'd rather always remember when you create this slice using extremely.
Then it first create an airy and after death return this nice reference to it.
Now go to this code and do an example.
OK, first create a project folder like the slices and create a file like main that cool and create
package package main and create main function.
Find me
first creating this list by using the VAT keyboard.
For the example that is, Slice one equals square brackets without any links and tie for the example
a string and initialize value by Groove
Java
Seashore and third and the next line display.
This nice variable FP is nice long column and set the value to this last one.
Now creating a slice by using shorthand declaration, for example, a slice to call in equal.
Esquire brackets.
We don't define any lengths and define time for the example end and initialize value by one comma two,
three, four, five, six and seven.
Go to the next line and display these validated by the comment that simply dot print and it's nice to
call in
as lies too.
Now, in this case, we define to vary a bit first by the Vakil and second by the shorthand declaration
save the project and execute the code.
First, go to the project folder, see the slices and run the project.
Now we can see the output is nice.
One Go Jobar C-sharp Pen and it's like two one two three four five six seven.
We could define it slices by two ways.
First by accurate declaration and second shorthand declaration.
In order not to prolong the time of this session, we will finish it and we will continue the content
in the next session.
Goodbye.