Java Programming: Lesson 37 - OOP Review, Printing in a Non-Void Method, and instanceof
PLEASE SUBSCRIBE!!!
In the previous video (https://youtu.be/Y6DjYvwz1Gg), we tied up some more fundamentals of OOP by discussing modifications to the constructor calls of the superclass, as well as the Comparable interface. We review the Comparable interface in this video, as well as the fundamentals of OOP. We also talk about printing statements in a method that returns a value, as well as the use of the instanceof keyword.
22: A class represents a new data type. Declare private instance variables, create a constructor, create getter methods, create setter methods, and then test it out in a separate class that has a main method.
23: A class can have multiple constructors. It can also have a toString( ) method, which defines what it means to print an instance of a class (or set it equal to a String).
24: this refers to the current instance of the class. It is required to distinguish an instance variable from the name of a parameter coming in. Static methods and variables are called on a class, and instance methods and variables are called on an instance of a class. Public methods and variables are accessible to all classes, and private methods and variables are accessible only to the class in which they are defined
25: Arrays can store not only ints, doubles, chars, Strings, and booleans, but objects of any type. Same with 2D arrays
26: Integer, Double, String, and Boolean wrap the corresponding primitives into classes that have important methods and variables. They can also be used in ArrayLists
27: an ArrayList is a growable array of objects. There are multiple methods that can be researched and practiced, operations not available to static arrays discussed previously
28: More ArrayList methods are discussed, and we apply it to an arbitrary object
29: Javadocs is formal documentation that appears when a method is called or when you pull up the documentation for a class
30: Recursion occurs when a method calls on itself, probably with a different input
31: Inheritance is when a subclass extends a superclass. It inherits all methods from the superclass but is allows to override those methods or define its own.
32: Polymorphism occurs when an object is declared in the superclass but instantiated in the subclass. It will use the subclass's version of methods that appear in the superclass, but it cannot use methods that do not appear in the superclass.
33: Protected methods and variables are accessible only to the class in which they are defined and any subclasses (or sub-sub, sub-sub-sub, ... classes)
34: Abstract classes can have both concrete and abstract methods but cannot be instantiated
35: Interfaces can have only abstract methods and are implemented rather than extended
36: You can modify calls to a constructor or method by passing in different inputs in the parenthesis
In this lesson, we learn/remember that a class that returns values can also print something (or change the value of a variable). These are not mutually exclusive operations. We also talk about the instanceof keyword. y instanceof C returns true if and only if y is instantiated in C or a subclass of C (can be declared in a superclass).
2:55 Review of OOP Fundamentals
12:45 NEW: Methods that Return and Print Values
16:25 NEW: The instanceof Keyword
There's a little bit more review of the instanceof keyword in this video (https://youtu.be/JHo5JdkIr6g), but it is a little more advanced in the curriculum.
The next lesson is our last video of OOP, and it will review instanceof, overloaded methods, and arrays of abstract objects. https://youtu.be/xHZ_Rt6Gjz0
Thanks for watching, and PLEASE SUBSCRIBE!!!
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Java Programming: Lesson 37 - OOP Review, Printing in a Non-Void Method, and instanceof», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.