Learn the reasons why it’s not possible to call super.super.method() in Java.
Also find me here:
Baeldung Author
Kai Yuan
Kai Yuan has been a software developer for over 15 years. He builds enterprise Java applications in work. He has 20 years experience of Linux and is a big fan of the Vim editor. He is happy to help people at stackoverflow.com. He lives currently in Hamburg.
Here's what I've written (so far):
Baeldung on Java
- All
- Java String (41)
- Java List (25)
- Java Array (18)
- Core Java (18)
- Java Numbers (16)
- Java Map (15)
- Java IO (13)
- Java (11)
- Algorithms (9)
- Java Streams (8)
- Testing (7)
- Java Collections (5)
- Persistence (4)
- Maven (4)
- Spring Boot (2)
- Java Concurrency (2)
- XML (1)
- Spring Persistence (1)
- Networking (1)
- Java Web (1)
- Jakarta EE (1)
- Jackson (1)
- IDE (1)
Fix The Compile Error: class X is public should be declared in a file named X.java
Filed under Core Java
Learn about the compile error “class X is public should be declared in a file named X.java”, why it happens, and how to resolve it.
How to Diagnose a Null Exception Message in Java
Filed under Core Java
Learn what to do when you encounter a null exception message in Java.
How to Read an External Properties File in Maven
Filed under Maven
Learn to read properties files storing configuration values.
Extract IP Address From a String in Java
Filed under Java String
Learn how to parse one or more IPv4 addresses from a String in Java.
Filter a List by Any Matching Field
Filed under Java List
Learn how to filter a list of objects depending on whether any of their fields match a given string value.
Masking a String Except the Last N Characters
Filed under Algorithms, Java String
Learn how to mask a String so that only the last N characters are revealed in Java.
Calling getClass() From a Static Context
Filed under Core Java
Learn alternatives to calling the getClass() method from a static context in Java.
Finding the Closest Number to a Given Value From a List of Integers in Java
Filed under Algorithms, Java List
Learn how to search a list to find the number closest to a given value in Java.
Baeldung on Linux
- All
- Scripting (36)
- Files (32)
- File Editing (21)
- Text Processing (11)
- File Searching (11)
- Processes (10)
- Administration (10)
- Filesystems (6)
- File Viewing (6)
- User Administration (4)
- Search (3)
- File Permissions (3)
- Web (2)
- Security (1)
- File Compression (1)
- Boot Process (1)
How to Limit grep Context to “n” Characters in a Line
Filed under File Searching
Learn how to limit the grep output characters displayed before and after the match.
Guide to Linux dirname Command with Examples
Learn how to use the dirname command in Linux to extract the directory part of a given path.
Guide to Linux basename Command with Examples
Learn about how to use the basename command to determine the file or folder name for one or more paths.
Printing Quote Characters in AWK
Filed under Text Processing
Learn how to print single or double quote characters in AWK scripts.
How to Read the First and the Last Line From Input
Filed under File Viewing
Learn how to extract the first and last lines from an input file using a single command.
Printing Specified Lines From a File
Filed under File Viewing
Learn how to extract specific lines from a file by line numbers using sed and awk.
Replace the First n Matched Instances in a File
Filed under File Editing
Learn how to replace the first n pattern occurrences in a file using sed and awk.
How to Operate on Files Listed in a File
Learn to use various techniques to operate on files listed in a file.
What’s the Meaning of $! in Bash Scripting
Learn the meaning of the special shell variable $!.
Baeldung on Kotlin
- All
- Kotlin Collections (18)
- Kotlin Classes and Objects (10)
- Kotlin Basics (10)
- Kotlin Numbers (9)
- Kotlin Strings (7)
- Kotlin Functions (5)
- Kotlin (4)
- Kotlin Arrays (3)
- Testing (2)
- Functional Programming (2)
- Spring (1)
- Security (1)
- Libraries (1)
- Algorithms (1)
Resolving Compile Error: “Const ‘val’ is only allowed on top level, in named objects, or in companion objects” in Kotlin
Filed under Kotlin Classes and Objects
Learn where and how you can use const val in Kotlin.
Resolving “Type Mismatch Inferred Type is Unit But Void Was Expected” in Kotlin
Filed under Kotlin Functions
Learn how to solve the “Unit but Void was expected” compilation error in Kotlin.
Iterating Enum Entries in Kotlin
Filed under Kotlin Basics
Learn how to loop over the entries of an Enum in Kotlin.
Difference Between clearAllMocks() and unmockkAll() in MockK
Filed under Testing
Learn about the difference between clearAllMocks() and unmockkAll() in MockK and when to use each one.
Serialize Enum Property to JSON in Kotlin
Filed under Libraries
Learn how to serialize a Kotlin enum property to JSON using Kotlin libraries.
Finding First Match in Nested Lists in Kotlin
Filed under Algorithms, Kotlin Collections
Learn how to search through a list of lists in Kotlin to find the first matching element.
Conditional Exception Throwing in Kotlin
Filed under Kotlin
Learn different approaches to throwing an exception when a condition is true in Kotlin.
Pass a Function as Parameter to Another in Kotlin
Filed under Kotlin Functions
Learn about how functions can be passed as parameters to other functions in Kotlin.
Matching Varargs Using MockK in Kotlin
Filed under Testing
Learn how to use the MockK mocking library to match varargs arguments in Kotlin.
Baeldung on Ops
- All
- Git (5)
Remove File From Git Repository Without Deleting It Locally
Filed under Git
Learn how to remove a file or directory from a Git repository but keep its local copy
How to Get the Current Branch Name in Git
Filed under Git
Learn how to get the Git branch name we’re currently working on
Delete a Git Branch Locally and Remotely
Filed under Git
Learn how to delete Git branches
Move Existing, Uncommitted Work to a New Branch in Git
Filed under Git
Learn a couple of quick ways to move uncommitted changes to a new Git branch
Squash the Last X Commits Using Git
Filed under Git
Learn what Git squashing is, talk about when we need to squash commits, and take a closer look at how to squash commits