RUVIDEO
Поделитесь видео 🙏

functions in java | function without argument without retrun value смотреть онлайн

📁 Обучение 👁️ 16 📅 02.12.2023

In this video you will learn about functions in java.

Functions / Methods in Java
A function/method is a block of code that performs a specific task. A function only runs when it is called.

Dividing a complex problem into smaller functions/methods makes our program easy to understand and reusable.

Functions are used to perform certain actions, and they are important for reusing code.

They allow to define the function once, and use it many times.

We can have any number of functions in a program.

There are two types of function:

Standard Library Functions: Predefined in Java classes inside packages.
User-defined Function: Created by users as per need.

Java User-defined Function

JAVA allows the programmer to define their own function and use the function when needed.
When the function is invoked from any part of the program, it executes the code defined in the body of the function.

Every user defined function has two parts:

i)Function definition
ii)Function call

Function definition
The function definition has following syntax:


returntype functionname(datatype parametername)
{ //code goes here
return value;
}

Function call
The function call is used to activate the function definition. The function call looks like as follows:
functionname(argumentifany);

The function is always called from another function.

Depending on the type, a function can take argument or can return value using return keyword. We will discuss them later.

We can create user defined function in following four ways:
i)Function without argument, without return value
ii)Function with argument, without return value
iii)Function without argument, with return value
iv)Function with argument, with return value

Function without argument, without return value
It is the simplest type of UDF. In this type of function all input, calculation and output are done in function body(definition).

The definition of this type of function looks like as follows:
void functionname(void)
{ //code goes here
}


The call of this type of function looks as follows:
functionname();

Note:
a) In OOP a static method can use other static members of that class directly.
b) The static method cannot use non-static members of the class directly.
c) In java, the main method is always static, so it can use other static methods of the class.
d) we qualify methods with static keyword, so that they can be used directly inside the main.

Q: WAP to create a function which prints sum of two numbers

Learn C Language from beginning
https://www.youtube.com/watch?v=xLWhGnFuLH4&list=PLZwkYDh1QECvRe8-gEy4Ph7wf8MytR-St

Learn C++ from beginning
https://www.youtube.com/watch?v=elfAOLs5550&list=PLZwkYDh1QECuzxXWkTWCVAwlufNDBufH9

Learn Java from beginning
https://www.youtube.com/watch?v=s_XKMOB1WxQ&list=PLZwkYDh1QECutGr1EhT0D8BwBzo89XRrE

Learn Python from beginning
https://www.youtube.com/watch?v=W1bVmrzLG-w&list=PLZwkYDh1QECuTE191SM85sW_0NlBmw01m

Learn PHP from beginning
https://www.youtube.com/watch?v=7S129O-xqqM&list=PLZwkYDh1QECsxwXPwMSb3zUoaGV8mMtri

Connect me on linkedin
https://www.linkedin.com/in/tarrunverrma

Connect me on instagram
https://www.instagram.com/the_ultimate_coding_stuff/

Follow me on twitter
https://twitter.com/Tarrunverrma

Join my telegram channel
t.me/tarunvermasir

#tarunsir #javatutorial #learnprogramming #coding #java #function

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «functions in java | function without argument without retrun value» бесплатно и без регистрации, вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.