Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello 
I am new to programming, if you can help with small code what it means
public void Encode(Video video){
//function 
}
what this (Video video) means?
I am little confuse with it.
below is the link, video at 1:26 is the code
<a href="">https://www.youtube.com/watch?v=jQgwEsJISy0</a>

What I have tried:

<pre>public void Encode(Video video){
//function 
}
Posted
Updated 23-Aug-17 20:07pm
v3

Start here : Functions[^]
 
Share this answer
 
Comments
Member 13369206 24-Aug-17 1:33am    
Thx. I know the parameter can be int, string, array,etc...but what this (Video video) come from...where type is Video and parameter ask is video too, where this Video is define, or is it custom extended class
what this means?
Mehdi Gholam 24-Aug-17 1:38am    
Probably an example, in any case "Video" is the type "video" is the parameter name, if you have the complete solution use "right click -> goto reference" on Video to go to the place it is defined.
Member 13369206 24-Aug-17 1:43am    
do you mean its custom user class, where user can define what's event type and it's parameter?
Mehdi Gholam 24-Aug-17 1:46am    
It's custom in the sense that it is not part of .net (that I know of) and someone created it.
Member 13369206 24-Aug-17 1:56am    
ok thx
When you declare a method, the declaration statement has several parts:
C#
access-type return-type method-name (parameter-list) 
   { 
   ... body ...
   }
Where
access-type is one of private, public, protected, internal, protected internal, or omitted completely.
return-type defines what type of value the method returns to the caller
method-name defines what name will be used to execute the method from other code
parameter-list defines what values must be passed to the method when it is called.
The parameter-list is a sequence of parameter definitions, separated by commas:
C#
access-type return-type method-name (parameter-definition, parameter-definition, ...)

Each parameter-definition declares a local variable which is available only within the method, and which must be passed a value when you call the method. The definition follows exactly the same format as that for a "normal" variable:
variable-type variable-name (with an optional initializer)

And the variable-type can be any type which is known to the system at that point in the code - this includes all the types you are used to, such as int, string, byte[], and so on, but also any of the types that you can define in your code, or import via an external assembly.

So your method declaration of
C#
public void Encode(Video video)
   {
   ...
   }
Says that the method accepts a parameter which is a Video type, and is accessible within the method by the name video

The type Video is presumably a class type that has been defined elsewhere in the code - it's not a standard .NET class name.

This is why I hate you-tube video tutorials: they are generally made by people with little or no actual knowledge, and less training ability than video skills. Ignore them, get a book - or better a course - and learn properly. video tutorials are normally a complete and utter waste of your time, his time, and electrons...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900