Object-Oriented Programming with Java
From objects and classes to methods, overloading and recursion.
Start with lecture 1
20 lectures
- 01OOP Concept: ObjectIn object-oriented programming (OOP), objects are the first thing you think about when making a program, and they are also the units of code that come out of…
- 02OOP Concept: ClassA class is a template in object-oriented programming that specifies how to construct objects, what their initial values should be for state (in the form of…
- 03Introduction to JavaOracle created the programming language Java in 1995. 3 million Java-powered machines.
- 04Installation of JavaSome computers may already have Java installed.
- 05SyntaxIn the previous chapter, we created a Java file named Main.java and printed "Hello World" to the screen using the following code:
- 06VariablesVariables are containers for storing data values.
- 07Data TypesAs explained in the previous chapter, a variable in Java must be a specified data type:
- 08Type CastingType casting is when you assign a value of one primitive data type to another type.
- 09OperatorsOperators are used to perform operations on variables and values.
- 10StringsIt's common practice to save the text in strings.
- 11MathThe Java Math class has many methods that allows you to perform mathematical tasks on numbers. The Math.max(x,y) method can be used to find the highest value…
- 12BooleansIt's common practice in computer programming to work with data types that accept only binary values, such as:
- 13If … ElseJava is compatible with the standard mathematical logical conditions:
- 14Switch CaseInstead of writing many if..else statements, you can use the switch statement.
- 15LoopsA block of code can be run in a loop as long as a certain condition is met. Loops are helpful because they save time, cut down on mistakes, and make code…
- 16ArraysArrays are used to store multiple values in a single variable, instead of declaring separate variables for each value.
- 17MethodsMethods are blocks of code that only run when they are called. You can send parameters, which are pieces of data, into a method. Methods are ways to do things,…
- 18Method OverloadingWith method overloading, multiple methods can have the same name with different parameters:
- 19RecursionRecursion is the process of calling a function from another function. This method gives you a way to break down hard problems into smaller, simpler ones that…
- 20Creating and Processing ArraysThe array is a type of data structure in Java that stores a fixed-size collection of elements of the same type in order. An array is a place to store a group…