Skip to Content
Learn Reflection with Java
on-demand course

Learn Reflection with Java

with Heinz Kabutz
March 2024
Intermediate
4h 9m
English
Pearson
Closed Captioning available in English

Overview

Over 4 Hours of Video Instruction

A well-rounded Java programmer should know reflection, when to use it, and more importantly, when not to use it.

Overview:

Reflection is a powerful Java feature that can be used to expand the capabilities of a program, to examine the class or object internals at runtime.

Java Reflection is quite powerful and can be very useful. Java Reflection makes it possible to inspect classes, interfaces, fields, and methods at runtime, without knowing the names of the classes, methods, etc. at compile time. Java Reflection is useful for creating generic code, implementing dynamic frameworks, and testing and debugging. In this course, we start with the basics, then show how reflection works with the more modern language features such as sealed classes and records. We also show how arrays can be manipulated and created via reflection. Lastly, we show MethodHandle and VarHandle. Learn from hands-on exercises that are followed by demos revealing the solutions.

Some key points covered in this course:

  • Save programming time by writing dynamic solutions to reoccurring problems.
  • Learn how dynamic coding via reflection affects Java performance and correctness.
  • A well-rounded Java programmer should know reflection, when to use it, and more importantly, when not to use it.

About the Instructor

Heinz Kabutz is the author of “The Java Specialists’ Newsletter,’ where he explores interesting tips and tricks from the Java Programming Language. He has a PhD in Computer Science. Heinz has programmed significant portions of several large Java applications and has taught Java to thousands of professional programmers. He is a regular speaker at all the major Java conferences.

Skill Level:

  • Beginner to Intermediate

Learn How To:

  • Inspect a class and find methods, fields, and constructors at runtime
  • Call methods, change fields, even if they are private
  • Write more general code that can be reused in many different contexts
  • Understand VarHandles and MethodHandles and know when to use them
  • Know how sealed classes and records can be inspected via reflection

Course Requirement:

  • Pre-requ’s: Students should be very familiar with Java 11, understanding data structures, object orientation, recursion and modern Java syntax.
  • Prior experience with reflection is a bonus, but not necessary.

Who Should Take This Course:

  • Profile: Java programmers, programmers of other languages new to Java.

About Pearson Video Training:

Pearson publishes expert-led video tutorials covering a wide selection of technology topics designed to teach you the skills you need to succeed. These professional and personal technology videos feature world-leading author instructors published by your trusted technology brands: Addison-Wesley, Cisco Press, Pearson IT Certification, Sams, and Que Topics include: IT Certification, Network Security, Cisco Technology, Programming, Web Development, Mobile Development, and more. Learn more about Pearson Video training at http://www.informit.com/video.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Watch now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Hands-On Software Architecture with Java

Hands-On Software Architecture with Java

Giuseppe Bonocore
Java Fundamentals

Java Fundamentals

Matt Thornfield
Java 8 in Action

Java 8 in Action

Alan Mycroft, Mario Fusco, Raoul-Gabriel Urma

Publisher Resources

ISBN: 9780138314767