Special offers now — see discounted courses.
day
:
hour
:
min
:
sec
See special offers
Learn Reflection with Java

Learn Reflection with Java

4h 9mIntermediate2024-10-23

Authors

Pearson

Pearson

Heinz Kabutz

Heinz Kabutz

Course details

Reflection is a powerful feature in Java that can be used to expand the capabilities of a program, or to examine a class, method, or object at runtime, even if you don’t know its name. In this course from Pearson, get started with the basics, then learn how reflection works with the more modern language features such as sealed classes and records, as well as how arrays can be manipulated and created via reflection. Along the way, explore the purpose of MethodHandles and VarHandles to find out when and how to use them both like a pro.

Learning objectives
Inspect a class and find methods, fields, and constructors at runtime.
Call methods and 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.
Inspect sealed classes and records via reflection.

Skills covered

JavaProgramming FoundationsOracleProgramming LanguagesSoftware DevelopmentOne-Off

Concepts

0. Introduction

  • 01 - Learn reflection with Java - Introduction

Lesson 1 - Introduction to Reflection

  • 02 - Learning objectives
  • 03 - Who am I
  • 04 - Why learn reflection
  • 05 - Class class
  • 06 - Method
  • 07 - Modifier and access flag
  • 08 - Constructor
  • 09 - Generics
  • 10 - Nested classes
  • 11 - Sealed classes
  • 12 - Records
  • 13 - Exercise

Lesson 2 - Deep Reflection

  • 14 - Learning objectives
  • 15 - Making private members accessible
  • 16 - Performance considerations

Lesson 3 - Arrays

  • 17 - Learning objectives
  • 18 - Accessing elements
  • 19 - Creating new
  • 20 - Exercise

Lesson 4 - java.lang.invoke

  • 21 - Learning objectives
  • 22 - MethodHandles.lookup
  • 23 - privateLookupIn()
  • 24 - MethodHandle
  • 25 - MethodType
  • 26 - VarHandle
  • 27 - Unreflecting
  • 28 - Exercises

Summary

  • 29 - Learn reflection with Java - Summary

Related courses

Related learn paths

About us

LyndaKade is a leading learning platform that helps people learn business, software, technology, and creative skills to achieve personal and professional goals.

Phone numberAparat ChannelTelegram SupportTelegram ChannelInstagram Page

All rights to this site belong to LyndaKade.

Terms of Service|Privacy Policy

نماد الکترونیک enamad در صورت اتصال با آی‌پی داخل کشور، نمایش داده خواهد شد.
logo-samandehi - لوگو ساماندهی
zarinpal
zibal