Everything You Need to Learn About Java

From OOPs to GenAI - Your Shortcut to Java Mastery

Everything You Need to Learn About Java

Photo by Ben White on Unsplash

Roadmap you need to know:

  1. Object Oriented Programming in Java

  2. Advanced Java and Java 8 Programming

  3. JUnit and Enterprise Architecture

  4. Java Persistence

  5. Web Development - Servlet and JSP

  6. Spring Core

  7. Spring ORM

  8. Spring MVC

  9. Java with GenAI


💡
Well, just so you know, the first two units are going to be the most challenging yet rewarding. They may help you with skills to tackle basic DSA problems in Java. Unit 2 shifts gears, focusing on essential tools like Maven for building projects and Git for version control, making you ready for real-world development.

Unit 1: OOPs in Java

  1. Java Introduction: Java Architecture and Features, Java Keywords, Datatypes and Operators, Control Structures

  2. Class and Objects: Class and Object​, Getters and Setters​, Access Modifiers​, Garbage Collector and Methods

  3. Arrays and Strings: Array​, String, String Buffer and StringBuilder in Java

  4. Class Relationship: Class Association, Inheritance and Method Overriding​, Abstract Keyword

  5. Binding and Interface: Static and Dynamic Binding​, Static and Final keyword​, Interface and Design Patterns

Unit 2: Advanced Java and Java8

→Advanced Java

  1. Exception Handling : Exception Types and Exception Hierarchy, Catch and Handle exceptions, Design Custom Exceptions

  2. Collection API: Part 1: Collections and use of collections, advantages of using collections and collection hierarchy, List and Set implementations

  3. Collection API: Part 2: Map implementation, comparator and comparable interfaces

  4. Multithreading: Multithreading/Concurrency, Thread: Creation, Life-cycle, Priorities, Stack Implementation, Methods, Synchronization, Inter-thread Communication

  5. Java 8 Features: Interface, Annonymous Inner Classes Lambda Expressions, Stream API, Functional Interfaces, Date and Time API

Software Development Practices

  1. SCM using Git: Intro to Version Control, Intro to Git, Common Git Terms, Working with Git and GitLab

  2. Code Quality: Coding standards, Importance of Code Review, Type of code review, Automated Code Review tools, SonarQube usages, SonarLint as eclipse plugin for code analysis

  3. Sonar Qube: Code Quality Automation and its benefits​, Types of Code Quality​, Static code analysis, Difference between Static Code Analysis and Dynamic Code Analysis​, Tools available for Code Quality​, State SonarQube features and its benefits

  4. Sonar Qube Components: Architecture of SonarQube​, Processes of SonarQube Server​, Database of SonarQube​, SonarQube Plugins​, How to use code analysis using SonarQube Scanners, SonarQube Workflow​, code analysis using SonarLint in Eclipse

  5. Working with Sonar Qube: SonarQube dashboard overview​, Manage projects using Project tab, Rules and its fields​, Quality profiles​, Quality gates and its types

  6. Maven Introduction: Scope of Build Automation​, Build Tool and its benefits​, Life cycle of build tool and its phases​

  7. Maven Structure: Structure of Maven​, pom.xml and its elements​, super POM, minimal POM and effective POM​, archetype and its types​, Understand how to create a maven project based on the archetypes and executes with different goals

  8. Maven Repositories and Dependencies: Describe the way to store set of artifacts as Maven repositories, Local Repository, Central Repository, Remote Repository​, Maven Dependency and configuring the dependencies in pom.xml, Dependency hierarchy; transitive dependency; dependency management​, Types of dependency scope​, Process of dependency search sequence

  9. Maven PlugIn: Categories and types of plugins​, MOJO and to configure the same in pom file, configuration of plugin in pom file, Surefire plugin and its implementation

  10. Input Output: Writing data to character & byte streams, chain of IO streams and serialization


Bravo! You've made it this far! 😉 Step ahead only if you're ready to master the road to greatness — yes, it's challenging, but you've already tackled the tough stuff. From here on, things will smoothen out a little (well, just a little). Let’s go!

Unit 3: JUnit and Enterprise Architecture

  1. JUnit 5: Unit Testing Conceps using x-testing framework, JUnit 4 v/s JUnit 5, Architecture, Installation, JUnit5 Annotations

  2. Enterprise Architecture & Patterns: Java EE Patterns, Architectural Patterns, Patterns of Enterprise Architecture (EA)

  3. HTML, CSS & Javascript: Web based Application Programming, Tools, GUI, HTTP, Web page construction

  4. XML & XSLT: XML features and purpose, rules for well-formed XML, Key features of the XML Schema, XML validation and transformation (XML and XSLT)

Unit 4: Java Persistence

  1. JDBC: Role of JDBC Driver, JDBC API (Connection to DB), CRUD operations using Statement interface, CRUD operations using Prepared Statement interface

  2. Introduction to ORMJPA: JPA and bootstrapping of JPA, CRUD operations on entities using JPA, entity life cycle

  3. JPA Entity Relationships: OneToOne, ManyToOne, OneToMany, ManyToMany, multiplicities b/w entities

  4. JPQL: Select Operation ,DML Operations, Named Queries, Join Queries, Aggregation Queries

Unit 5: Web Development - Servlet and JSP

  1. Web Development - Servlet Programming: Servlet Life Cycle​, Servlet Context and Servlet Config, Request Dispatcher​, Session Management

  2. Web Development - JSP: Dynamic web page using JSP, JSP lifecycle​, JSP scripting, and directive elements to create web pages​, implicit objects and action elements to create web pages

  3. Web Development - JSTL: Dynamic web pages using:​ JSTL core tags​ and JSTL formatting tags

Unit 6: Spring Core

  1. Spring Core: container component model​, IOC using dependency injection and autowiring​, spring core annotations​, loosely coupled application using Spring IOC container witH XML​ and Java

  2. Spring Test: JSR-330 Annotations, JSR-250 Annotations, Transactional and Rollback Annotations

Unit 7: Spring ORM

  1. Spring ORM: Spring Core with JPA Integration**,** Spring Core with JPA Integration with Transaction Manager, Transaction Propagation, Transactional Attributes, Spring ORM Integration, Spring ORM Transaction Management

  2. Spring JPA Data: Spring JPA Integration, Spring JPA Data, Spring JPA Data Repositories, Spring JPA Data Repositories, Spring JPA Data writing Queries

Unit 8: Spring MVC

  1. Spring MVC Introduction: MVC - Model2 Architecture, Spring MVC and Front view Controller Configuration, Context Configuration, ContextHierarchy, ViewResolvers

  2. Spring Form: Spring MVC application using Spring form and form elements​, Spring Model v/s Request scope, validations, Exception Handlers

  3. Spring MVC JPA Introduction: Session Attributes, Spring MVC with Spring JPA Integration, Spring MVC with Spring JPA Data Integration

  4. Spring Rest: Services using Spring REST, Spring REST Integration with Spring JPA Data, RestTemplate

  5. Spring Security Part 1: Customizing Access Denied Handler View, Customizing Login Page, Authencation Provider, Spring MVC application implementing Spring Security with JDBC authentication provider

  6. Spring Security Part 2: Implement security in application using Spring Security Expression Language, applications to detect concurrent sessions, Implement security at Service layer of an application

  7. Spring Boot: Spring Boot Application​ microservices, Configuring Jetty container as a default container, Content negotiation

Unit 9: Java with GenAI

  1. Introduction to Generative AI: Basics of Generative Al, Use Cases of Generative Al, Large Language Models, Generative Al tools, Prompt engineering, Prompt design Strategies/ Techniques, Issues/ concerns and considerations

  2. Generative AI in Java - Java with VertexAI

    Steps to Integrate Java with Vertex AI

    Set Up Google Cloud Environment:

    • Create a Google Cloud project.

    • Enable Vertex AI API.

    • Create a service account with Vertex AI User and Storage Object Viewer roles.

    • Download the service account JSON key.

    • Install and initialize Google Cloud SDK (gcloud init).

  3. Set Up Java Development Environment:

    • Ensure Java 8+ is installed.

    • Install Apache Maven (if not already installed).

  4. Add Dependencies to pom.xml

<dependency>
  <groupId>com.google.cloud</groupId>
  <artifactId>google-cloud-vertex-ai</artifactId>
  <version>1.0.0</version>
</dependency>
<dependency>
  <groupId>com.google.cloud</groupId>
  <artifactId>google-cloud-storage</artifactId>
  <version>2.4.0</version>
</dependency>
<dependency>
  <groupId>com.google.auth</groupId>
  <artifactId>google-auth-library-oauth2-http</artifactId>
  <version>0.28.0</version>
</dependency>

Authenticate Using Service Account:

  • Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to your service account JSON key.

  • On Linux/Mac:

export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account-key.json"
  • On Windows:
set GOOGLE_APPLICATION_CREDENTIALS=C:\path\to\service-account-key.json
  • Java Code to Interact with Vertex AI:
GoogleCredentials credentials = GoogleCredentials.fromStream(new FileInputStream("path/to/service-account-key.json"));
try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
    // Prepare the prediction request
    PredictRequest predictRequest = PredictRequest.newBuilder()
        .setModel("your-model-id")
        .setInstances("{ \"instances\": [{ \"input\": \"Hello Vertex AI\" }]}") // Example input
        .build();

    // Get predictions
    PredictResponse response = predictionServiceClient.predict(predictRequest);
    System.out.println(response.getPredictionsList());
}

Run Your Java Application:

  • Use Maven or your IDE to run the application:
mvn exec:java -Dexec.mainClass="VertexAIExample"

And that's a wrap! Phew! You've made it through all of it. Now, feel free to circle back to the top whenever you need a quick revision. After all, it's totally normal to not remember everything in one go. Don’t hesitate to hop back to where you’re stuck and pick up right from there!