CP1344: PROGRAMMING IN JAVA - LECTURE -32- DEFINING A CLASS (METHODS DECLARATION) - BCA- S3.
Methods Declaration
A class with only data fields (and without methods that operate on that data) has no life. The objects created by such a class cannot respond to any messages, We must therefore add methods that are necessary for manipulating the data contained in the class. Methods are declared inside the body of the class but immediately after the declaration of instance variables.
Method declarations have four basic parts:
The name of the method (methodname)
The type of the value the method returns (type)
A list of parameters (parameter-list)
The body of the method
The type specifies the type of value the method would return, This could be a simple data type such as int as well as any class type. It could even be void type, if the method does not return any value. The method name is a valid identifier. The parameter list is always enclosed in parentheses. This list contains variable names and types of all the values we want to give to the method as input. The variables in the list are separated by commas. In the case where no input data are required, the declaration must retain the empty parentheses.
Note that the method has a retun type of void because it does not return any value. We pass two integer values to the method which are then assigned to the instance variables length and width, The getData method is basically added to provide values to the instance variables. Notice that we are able to use directly length and width inside the method.
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «CP1344: PROGRAMMING IN JAVA - LECTURE -32- DEFINING A CLASS (METHODS DECLARATION) - BCA- S3.», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.