
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
Install the Java Development Kit and the Eclipse IDE to begin developing Java programs. Include the Java Runtime Environment bundled with the JDK, and let Eclipse handle text-file editing.
Create a hello world program in Eclipse by making a Java project, adding a class with a main method, and printing 'hello world' to the console.
Learn how to declare and initialize variables in Java, print results, and explore primitive types such as int, short, long, float, double, char, boolean, and byte with examples.
Learn how strings serve as non-primitive text types in Java, create string variables as objects of class String, concatenate with numbers, and print results to the console using Eclipse.
Learn how to implement while loops in Java by using boolean conditions, updating the control variable, and ensuring termination to avoid infinite loops.
Explore how for loops control iteration in Java by initializing a counter, setting a condition, and updating it, then print values with System.out.printf and format specifiers like %d.
Explore how Java if statements evaluate boolean conditions using equals and not equals, apply else and else if branches, and use break to control loops.
Explore getting user input with the scanner class, using System.in, prompts, and nextLine, nextInt, and nextDouble to read strings, integers, and decimals, while noting basic robustness and exception handling.
Learn to write single-line and multi-line comments in Java, and grasp variable scope with braces. Implement a do-while loop with a scanner to prompt the user until they enter 9.
Compare java switch statements with if statements, test text input with cases and breaks, and handle a default path using scanner input to control program actions like run or stop.
Explore arrays in java: distinguish primitive ints from reference types, allocate memory with new int[n], access elements by zero-based indexing, and iterate with a for loop, including inline initialization.
Master multidimensional arrays in Java, from two dimensional to four dimensional, using nested for loops to iterate and access elements with zero-based indexing and default values.
Explore classes, objects, and methods in Java, learn the structure of a method with void return, and practice creating objects, initializing variables, and calling methods.
Learn how void and return types shape what a method outputs and how to return values. Master passing parameters, maintaining order, and matching types for method calls.
Learn how Java packages structure code, prevent class name conflicts, organize subpackages with dots, imports, and conventions like reverse website names for unique package names.
Learn how constructors run when you create an instance and initialize instance variables. Use the this keyword to distinguish local from instance variables and explore constructor overloading and chaining.
Explore static and final keywords in Java, distinguish class variables from instance variables, and see how static data, constants, and object counting work.
Learn how inheritance lets a car class extend a factory, share methods, and access modifiers public, protected, default, and private control visibility.
Polymorphism in Java lets a subclass be used wherever a superclass is expected, demonstrated by vehicle and its car, with overridden design method.
Demonstrates encapsulation in Java by using private instance data, public getters and setters, and final constants, while protecting internal logic and reducing class coupling.
Explore java's numeric types, including byte, short, int, long, float, and double, and master casting between them, noting max/min values, decimal truncation, and string-to-integer conversion with parsing.
Explore interfaces in Java by creating and implementing an information interface across computer and vehicle classes, and learn how to use them to display consistent information.
Explore anonymous classes in Java by overriding methods on the fly with anonymous subclass and interface implementations, illustrating with a computer class and a phone interface.
Learn to read a file line by line in Java using the Scanner class, creating a File object and handling path syntax such as backslashes.
Explore the string builder class in Java and its mutability advantages over strings. Learn to use append for efficient concatenation, convert to string with toString, and master method chaining.
Learn how the Java toString method, inherited from the object class, provides readable string representations for objects like Employee by returning id and name when printed.
Learn how to compare objects in Java by overriding the equals method and choosing which fields define equality, with guidance on hashCode and using equals for strings.
Program a word guessing game to build confidence in Java basics. Create a guess the word game, a words helper, and a do-while loop to handle input and checks.
Explore how the random class in Java selects a word from an array. Create a char array and build the display with hyphens for unguessed letters using a for-each loop.
Continue refining game logic by replacing if-else with a ternary operation, capturing user input with a scanner, and updating guessed letters in the word via the words class.
Build a word guessing flow by checking if all letters are filled, showing the full word on success, and managing ten rounds with remaining rounds and game over.
Learn how to handle exceptions in Java, using try and catch and throws declarations. Understand stack traces and file not found exceptions when reading files with a scanner.
Explore declaring and handling multiple exceptions in Java with throws, try catch, and multi catch, and learn how catch order and parent-child relationships affect handling.
Explore runtime exceptions in Java, including null pointer, arithmetic, and array index out of bounds exceptions, and learn why these unchecked flaws should be fixed rather than caught.
Abstract classes in Java organize hierarchies with a base vehicle and shared engine; car and truck implement the abstract drive method, illustrating single inheritance and interface flexibility.
Explore non-static inner classes and static inner classes in Java, including local and anonymous classes. See how inner classes access the outer machine's data and group components like artificial intelligence.
Demonstrate passing by value in Java: primitives copy values, objects pass references; mutating an object can affect the original, while reassigning the parameter does not.
Explore lambda expressions in Java and how they pass a code block to a method. Compare them with anonymous classes and learn about functional interfaces, parameters, and return values.
Explore Java enums, a type that restricts a variable to fixed values like red, green, and blue, and use constructors and methods such as valueOf and name.
Learn how to serialize Java objects to a file and read them back using object output and input streams, with a vehicle class example and try-with-resources for safe file handling.
Serialize arrays and array lists of vehicle objects by implementing serializable, then read and write them using object output and object input. Use transient to prevent fields from being serialized.
Explore array lists and linked lists in Java, covering generics and add, get, iterate, and remove operations, and learn when to use each for end versus beginning or middle insertions.
This lecture covers hash maps in Java, creating a map with integer keys and string values, using put and get, and iterating with map.entrySet while noting order is not guaranteed.
Explore linked hash maps and tree maps, showing how linked hash maps preserve insertion order while tree maps sort keys in natural order, using the map interface and put-based demonstrations.
Explore hash set, linked hash set, and tree set in java, learning how they enforce unique elements, preserve insertion order, or sort in natural order.
Learn to sort lists in Java with comparators and the collections.sort method, including sorting strings by length, numeric values, and reverse alphabetical order.
Learn how to start threads in Java, including extending the Thread class and implementing Runnable, with practical examples on parallel execution and using sleep for delays.
Understand how two threads sharing data can cache and interleave results, and see how the volatile keyword prevents caching and ensures visibility, while preparing for thread synchronization in future lectures.
Explains how the synchronized keyword makes increments on a shared number thread-safe by using intrinsic locks, preventing interleaved access and enabling synchronized blocks of code.
Two threads interleave when updating separate lists, and synchronized blocks with two distinct locks fix data races and speed up execution.
Explore thread pools to manage multiple threads with a fixed thread pool, submit runnable tasks via an executor service, and wait for all tasks to finish.
Learn to coordinate multi-threaded work in Java with a thread-safe countdown latch. Six threads wait on the latch and proceed after await when it reaches zero.
Explore how wait and notify coordinate two threads via synchronized blocks on a shared object. The lecture shows pausing with wait and resuming with notify through an engine example.
Explore re-entrant locks as an alternative to synchronized, with a hands-on demo of two threads incrementing a shared value using a lock, try-catch-finally guarantees, and condition wait and signal.
Explore semaphores in Java to limit concurrent access with permits, learn acquire and release, and implement safe semaphore usage with try and finally to guarantee release for multi-threaded messaging.
Explore switch expressions in Java, replacing colon with arrows, avoiding breaks, and using yield to return values; learn to assign the switch expression to a variable such as meeting.
Explore how the var keyword enables type inference in Java from assigned values. Note that var cannot be used with generic types, uninitialized variables, or lambda expressions requiring explicit types.
Explore how text blocks in Java use three quotation marks to print multi-line strings without concatenation. Preserve line breaks and inner quotes when printing addresses, Json, or html.
Learn how sealed classes in Java 17 restrict inheritance by specifying permitted subclasses, using final, non sealed, or sealed subtypes, and applying the same rules to sealed interfaces.
Learn how record classes replace long boilerplate data carriers with concise syntax; they auto-generate toString, equals, and hashCode, emphasize immutability and limitations like no instance fields.
Discover virtual threads in Java 21, a lightweight, scalable, runtime-managed concurrency model that reduces memory use and simplifies thread management, with examples swapping traditional threads for virtual threads.
Explore unnamed classes and unnamed variables in Java 21, demonstrated with terminal compilation and preview features, including a main method without a class name and underscores for variables.
Explore sequenced collections in Java 21, including sequence collection, sequence set, and sequence map, and learn how they extend the collection interface to manage ordered data.
Explore the sequence set in Java 21, an interface extending sequence collection and set, with get first, get last, remove first, remove last, and reverse.
Learn how Java 21's sequenced map extends map with first and last entry operations, insertion, and reversal. Practice with a linked hash map to view keys and values.
Show how to use the spring initializr to generate a maven project with web dependencies, import it into an IDE, and run the spring boot application, while maven handles dependencies.
Run the Spring Boot application with an embedded Tomcat on port 8018 and verify it starts, then prepare to create a rest controller to serve results on localhost:8080.
Create a Spring Boot rest controller with @RestController and @GetMapping('/') that returns 'my application' at localhost:8080.
Maven manages dependencies for Java apps (like Spring Boot), downloads jars from the central repository, and configures the build path for compiling and running.
Learn the Maven standard directory structure with a pom.xml, including src/main/java, resources, webapp, src/test, and target, to simplify dependency management and cross-IDE collaboration.
Explore Maven concepts through the POM file, dependencies, and plugins, and learn how project coordinates like groupId, artifactId, and version drive dependency management and central repository downloads.
Explore the spring boot project structure in a maven project—src/main/java, src/main/resources, and test—plus mvnw wrapper files and the application.properties file.
Demonstrates configuring the application.properties file in Spring Boot, created by Spring Initializer and located under src/main/resources, and injecting properties like server.port, instructor.name, and class.name with @Value.
Explore how spring boot starters simplify maven dependencies by bundling web, security, and data jpa components for quick spring applications, and learn to inspect starters in your ide.
Learn how the Spring Boot starter parent defines defaults in pom.xml with groupId, artifactId, and version, enabling dependency version inheritance and configuring the Spring Boot plugin for mvn spring-boot:run.
Learn how spring boot devtools automatically restarts your app on code changes by adding the spring-boot-devtools dependency to your maven pom; in IntelliJ, enable auto build.
Configure IntelliJ to build automatically and enable automake, then add the spring boot dev tools dependency to enable automatic reloading of changes.
Discover how Spring Boot Actuator exposes monitoring endpoints under /actuator, such as health and info, by adding the spring-boot-starter-actuator dependency and customizing info via application.properties.
Add Spring Boot actuator and expose health and info endpoints by updating pom.xml and application.properties. Verify the endpoints at /actuator/health and /actuator/info.
Secure spring boot actuator endpoints by adding the spring boot starter security dependency and requiring login to access beans, health, and other endpoints, with exclude via management.endpoints.web.exposure.exclude.
Add spring security to protect your rest endpoints, learn the default user and generated password, and customize access by excluding health and info endpoints in application properties.
Define custom properties in application.properties and inject them into a Spring Boot app with @Value. The example uses instructor.name and student.class in a REST controller and runs in IntelliJ.
Learn to define custom properties in application.properties, inject them with the addValue annotation in a Spring Boot app, and expose a classInfo endpoint that returns the instructor name and class.
Configure Spring Boot server using application.properties to set the port, context path, logging levels, and actuator endpoints. Explore common web, security, and data properties, including datasource URL and credentials.
Explore inversion of control as an object factory managed by the Spring container, enabling configurable instructor objects across languages via XML configuration, Java annotations, or Java source code.
Explore Spring dependency injection and the Spring container, applying the dependency inversion principle with constructor and setter injection, plus auto-wiring of components like instructors.
Define a dependency interface and java instructor, annotate them as spring beans, and build a course controller using constructor injection to expose the programming exercises endpoint.
Learn constructor injection in Spring as it creates an instructor instance and injects it into the course controller. See Spring's broader capabilities, including REST APIs and database access.
Set up a Java spring boot project with Spring Initializr, select Maven and Java, add spring-boot-dev-tools and spring-web-support, download, unzip, and open the project in IntelliJ.
Define a dependency and interface, implement a Java Instructor class as a Spring bean, and expose a programming exercise endpoint through a constructor-injected REST controller.
Understand how Spring Boot performs component scanning to auto-register beans from your package and sub-packages. Configure base packages to scan across multiple packages using the Spring Boot application annotation.
Learn how to configure Spring Boot component scanning by adding the AddSpringBoot annotation to explicitly list base packages, test startup, verify injection, and restore default scanning for clean package structure.
Learn setter injection in spring by defining setter methods, configuring dependency injection with auto-wired, and having spring inject an instructor implementation into the course controller.
Practice setter injection by creating a setter method in the course controller and annotating it with autowired, showing dependency injection works when updating the instructor.
Explore field injection with the autowired annotation, showing how Spring injects a private field in a controller and why this approach is discouraged for testability, unlike constructor or setter injection.
Explore annotation-driven auto-wiring and qualifiers in Spring, resolving multiple bean implementations by using @Qualifier with bean IDs (lowercased class names) for constructor and setter injection.
Explore constructor injection with Spring by creating multiple instructor implementations (Java, PHP, JavaScript, Python), and resolve bean ambiguity using qualifiers to control which programming exercise displays.
Master the primary annotation to select a single instructor among Java, JavaScript, Python, and PHP implementations, and understand how qualifier annotation can override it.
Learn to resolve multiple implementations in Spring by applying the primary annotation to designate a lead instructor, replacing qualifier usage for injection in a controller.
Learn how lazy initialization defers bean creation in spring boot, using @Lazy and global spring.main.lazy-initialization to initialize services only when needed, improving startup time while weighing memory considerations.
Enable lazy initialization and mark PHP instructor as lazy to delay bean creation until needed. The lecture shows startup order—Java instructor initializes first, then course controller, via console logs.
Explore bean scopes in spring, learn how the lifecycle and sharing affect instance creation, with singleton and prototype examples, plus session and request scopes.
Learn about spring bean scopes by refactoring a course controller, removing lazy initialization in application.properties, using @Qualifier for dependency injection, and validating singleton behavior versus other scopes.
Create a new getMapping endpoint check that returns a boolean indicating if the bean is the same instance, revealing true for singleton and false for prototype.
Learn bean lifecycle methods in Spring, from init after bean creation to destroy on shutdown, using post construct and pre destroy to run custom initialization and cleanup logic.
Define init and destroy lifecycle methods using post construct and predestroy annotations, observe their execution in bean lifecycles, and understand prototype scope affects destruction and lazy loading.
Configure Spring beans with a Java config class by defining a @Bean method that creates an instructor. Inject the bean into the controller using the default bean ID.
Configure a bean by creating a C-instructor class without component annotation, define it in a configuration class with @Bean, and inject it by bean ID to verify in the app.
Discover how Hibernate and JPA enable object-relational mapping to save, retrieve, and query Java objects with minimal JDBC code, using EntityManager.persist, find, and the JPA query language.
Hibernate and JPA sit on top of JDBC, using the JDBC API for database connections while your app saves and retrieves objects via the JPA API.
Install and configure MySQL, explore the server engine and MySQL Workbench GUI, and set up databases, schemas, and basic data operations for your Java projects.
Download scripts, user.sql and employee.sql, from resources, then set up database by creating a MySQL user named SpringTutorial and an employee table with id, first name, last name, and email.
Set up a local MySQL Workbench environment, create a Spring Tutorial user, create the Employee schema and table, establish a SpringTutorial connection, and prepare to insert data with Java code.
Set up a Spring Boot project with Hibernate as the default JPA, auto-configure the data source, and wire the Entity Manager for queries using Spring Initializr and Spring Data JPA.
Create a Spring Boot project with Spring Initializer using Maven and Java, add MySQL driver and Spring Data JPA, then generate, unzip, and rename to crudep-employee.
Set up a spring boot project in IntelliJ, add a command line runner to print hello after beans load, configure a MySQL datasource, and disable the spring boot banner.
Map a Java class to a database table with JPA annotations, including @Entity, @Table, and @Column; define a primary key with @Id and generation strategies in Hibernate for Spring Boot.
Create a JPA entity named Employee, map it to the Employee table using Entity, Table, Id, and Column annotations, and configure id generation with GenerationType.IDENTITY.
Learn to build a Java CRUD app using a DAO with JPA, including saving and managing employees via an entity manager, data source, and Spring Boot configuration.
Explore how MySQL auto-incrementing primary keys work as you add multiple employees from Java, verify IDs with a CRUD app, and prepare for read, update, and delete of objects.
Learn to change MySQL auto increment values with alter table and reset them using truncate to start IDs at 1,000 or 2,000, and explore reading the objects with JPA.
Learn how to read an object in JPA by using EntityManager.find to fetch an employee by its primary key, returning null if not found.
Implement a findByID method in the employee DAO using EntityManager.find, then read and display Cassie Smith by ID. Verify the retrieved record in the database.
Query multiple objects using jpql to select from the employee entity, apply where and like predicates, and use named parameters with the entity manager.
Implement a findAll method in the employee DAO using JPQL and an EntityManager to fetch, display, and sort a list of employees by last name, ascending or descending.
Learn to implement a parameterized JPA query to fetch employees by last name using a typed JPQL query, update the main app to call findByLastName and display results.
Update objects with JPA by locating an entity with EntityManager.find, modifying fields, and using merge or bulk updates via createQuery; implement DAO methods and transactional updates in the app.
Implement the update method in the employee DAO, mark it transactional, locate the employee by ID, and use the entity manager merge to apply changes, then verify in SQL workbench.
Learn to delete a JPA entity using EntityManager.find and remove, delete queries with ExecuteUpdate, and implement a delete method in the DAO, including transactional annotation and command line integration.
Implement the delete operation in the DAO with JPA by finding an employee and removing it via the entity manager. Also add deleteAll with executeUpdate to report rows deleted.
Create database tables from java using hibernate and jpa annotations, with hibernate generating and executing sql, and compare ddl-auto options like create, drop, update, and validate for development versus production.
Configure logging to show sql statements, create and drop the employee table with Hibernate ddl-auto, and compare update versus create for automatic table generation.
Learn to build REST APIs and web services with Spring, handling JSON and HTTP messaging, and test with Postman while creating a CRUD REST interface.
Master json, plain-text, language-independent data format for storing and exchanging data, with objects in curly braces, name-value pairs in double quotes, and values like numbers, strings, booleans, null, and arrays.
Explore REST over HTTP and how POST, GET, PUT, and DELETE implement CRUD through a REST controller that handles requestMessage and responseMessage data.
Explore Postman by sending http requests without an account, test get methods against fake json APIs, and inspect responses featuring nested json objects.
Build a spring rest controller with a get endpoint at /test/greeting that returns hello. Test the endpoint in a browser or postman while learning spring boot starter web.
Set up a Spring Boot REST project via start.spring.io, configure Maven, Java, and Spring Boot Web dependency, then create a RestController with mappings for /test and /greeting that returns hello.
Learn to build a Spring Boot REST service by configuring a REST controller with addRestController and addRequestMapping, exposing /test and /greeting and returning hello.
Discover how JSON data binding converts JSON into Java objects and back, using Jackson behind the scenes. See how Spring REST automatically uses getters and setters to perform this conversion.
Create a Spring rest service for employees with a get endpoint at /api/employees that returns a json list of employee objects, with Jackson converting Java objects to json automatically.
Create a spring boot rest api by organizing packages for controllers and entities, defining an employee entity with getters and setters, and exposing /api/employees that returns JSON via Jackson.
Define a new get mapping endpoint to retrieve a single employee by id using a path variable. Bind the path variable to the method and return the employee as json.
Refactor the employee rest controller to initialize data once, expose get all and get by id endpoints using a path variable, and test with postman.
Learn to handle Spring rest exceptions by creating a custom error response, defining EmployeeNotFoundException, and returning a 404 JSON message with status, message, and timestamp.
Create a custom error response and employee not found exception, then throw it when an ID is missing. Use an exception handler to return a JSON 404 payload.
Implement custom exception handling in Spring Boot to return json error responses for an employee api, handling 404 not found and 400 bad request with detailed messages and timestamps.
Move the exception handling from the employee rest controller to a global controllerAdvice and annotate with addControllerAdvice to centralize error handling across all rest controllers.
Move global exception handling to a controller advice class in a Spring Boot app, delivering custom 404 and 400 messages like employee id not found.
Design a spring rest api by analyzing requirements, identifying the teachers entity, and mapping crud actions to http methods on /api/teachers, with json payloads and postman demonstrations.
Develop a spring boot rest api for a teacher directory with CRUD operations backed by a MySQL database, using Spring Data JPA for the DAO and REST controller.
Create a teacher dao using JPA in Spring Boot, implementing CRUD operations with an entity manager and JPQL queries, and expose it via a REST controller.
Configure IntelliJ to use Spring Boot devtools and enable auto build. Create a Teacher entity and a DAO interface, mapping fields to the database and providing a findAll method.
Implement the teacher DAO with constructor injection of an EntityManager and a JPQL query to fetch all teachers, then expose a rest endpoint at /api/teachers via TeacherController.
Define the service layer with a teacher service in the facade pattern, using multiple daos to aggregate data for a rest controller, with Spring's @Service and component scanning.
Create a service layer by defining the TeacherServiceInterface with findAll, implement it in TeacherService, inject TeacherDao via constructor, and delegate calls through the service to connect rest controllers with daos.
Implement dao methods for finding, saving, and deleting teachers using the entity manager, with save using merge for insert or update by id, and move transaction management to service layer.
Enhance the teacher DAO in Spring Boot by implementing the remaining CRUD operations—findByID, update, and deleteByID—through interface augmentation and entity manager usage for reliable persistence.
Implement service methods for findByID, update, and deleteByID in the teacher service, apply addTransactional for data-changing operations, delegate to the DAO, and prepare controller endpoints for full CRUD.
this lecture explains rest controller methods to fetch a single teacher by id and to create a new teacher, using post requests and content-type: application/json.
Create a post endpoint to add a new teacher via the rest api, binding json from the request body, setting id to 0 to force insert, and test with Postman.
Implement a put endpoint at /api/teachers to update a teacher in a Spring Boot REST controller, sending JSON with the ID and updated data, and return the updated teacher.
Learn to implement a Spring Boot delete endpoint for teachers, using a path variable id, validate existence, delete by id, return deleted id, and verify via Postman and MySQL.
Learn how spring data jpa replaces custom daos with a jpa repository interface that auto provides crud methods for any entity, eliminating implementation code and easing spring boot development.
Transform a dao-based setup into Spring Data JPA by creating a TeacherRepository, using JPA methods, handling optionals, and testing CRUD with Postman.
Discover how Spring Data REST automatically exposes REST endpoints from JPA repositories in Spring Boot, generating full CRUD APIs for entities like teachers with no extra coding.
Learn to enable Spring Data Rest, expose JPA repositories endpoints automatically, and customize the base path to /my API while testing with Postman.
Update a teacher by id with put on the correct url, sending the updated data in json without the id, and see how Spring Data REST provides crud endpoints automatically.
Explain Spring Data REST configuration, pagination, and sorting, including custom plural forms and path customization with repository rest resource annotation, plus default page size and 0-based paging.
Configure Spring Data REST endpoints by exposing /instructors, test endpoints with Postman, and implement pagination with a default page size and zero-based pages, plus sorting by last name.
Do you want to learn how to code and land a cool Java programming job? Java is a really popular language for creating applications and websites.
It's awesome because the code you write can run on any computer. Now is a great time for Java programmers to find jobs and freelance gigs.
This course is taught by super knowledgeable Java experts certified by Oracle. Once you finish, understanding Java will be a breeze. Moreover, this course includes the updates of Java.
The course covers each topic and makes things easy with simple examples. You get coding notebooks with each lesson for practice.
Learning Java can open up exciting opportunities in the tech industry. Java is widely used, making it a valuable skill for employers. This course not only equips you with the knowledge but also provides hands-on practice with coding notebooks.
The instructors, certified by Oracle, bring a wealth of expertise to guide you through the learning process. Whether you're a complete beginner or looking to enhance your coding skills, this course is suitable for all types of learners.
Don't miss the chance to improve your career and be part of the Java programming community.
Enroll today and embark on a journey to master these valuable and in-demand skills!