Lec 3
Lec 3
PROGRAMING
Writeline
Write
Read
Readline
Readkey
Function
String Functions ( substring,len,append,split,
Concat,interpolation,indexof)
FUNDAMENTALS OF
PROGRAMING
The + operator can be used between strings to combine them. This is called concatenation:
Methods are used to perform certain actions, and they are also known as functions.
Why use methods? To reuse code: define the code once, and use it many times.
class class_name
{
...
...
<Access_Specifier> <Return_Type> Method_Name()
{
public void GetUsers() {
}
// Statements to Execute // Statements to Execute
... }
...
}
FUNDAMENTALS OF
PROGRAMING
If you observe the above syntax, we defined the method in a class with various parameters, which
are
Access_Specifier - It is used to define an access level, either public or private, etc., to allow other
classes to access the method. If we didn’t mention any access modifier, then by default, it is
private.
Return_Type - It is used to specify the type of value the method can return. If the method is not
returning any value, then we need to mention void as the return type.