Test your knowledge of the ins and outs of local type inference.Given the following interface and two classesinterface Paintable { void paint(String color);}class House implements Paintable { private class Floor implements Paintable { public void paint(String color) { System.out.println("Floor painted to " + color); ...
Wednesday, May 31, 2023
Monday, May 29, 2023
What is Java Development Kit?
In the ever-evolving world of technology, Java has emerged as one of the most popular and widely used programming languages. With its versatility and extensive functionality, Java has found its place in a wide range of applications, from web development to mobile app development and beyond. At the...
Friday, May 26, 2023
Oracle Java: The Secret Ingredient Behind High-Performance Applications
In the world of software development, high-performance applications are the gold standard. Businesses and organizations strive to create applications that deliver exceptional speed, reliability, and scalability. Achieving such excellence requires the use of powerful tools and technologies, and one such tool that stands out from the crowd is...
Wednesday, May 24, 2023
Quiz yourself: When is a Java object still reachable?
The garbage collector can’t collect an object until it’s no longer available to any live thread.Given the following codeinterface Repairable {}class Car implements Repairable { class Clutch implements Repairable {} private Clutch c; public Car() { c = new Clutch(); } public Clutch getClutch() { return...
Monday, May 22, 2023
Quiz yourself: Java text blocks and escape sequences
If a triple double quote sequence indicates the beginning and end of a text block, how do you assign a triple double quote sequence to a string?Which of the following are valid Java text blocks? Choose three.A. var v1 = """""";. B. var v2 = """abc""";. C. var...
Friday, May 19, 2023
What Java Version is Java 18? A Comprehensive Guide
As technology continues to advance at a rapid pace, it's crucial for developers and businesses to stay up to date with the latest programming languages and frameworks. Java, being one of the most popular and widely used programming languages, has seen numerous updates and versions over the years....
Wednesday, May 17, 2023
Quiz yourself: Crossing Java’s CyclicBarrier in a multithreaded environment
A CyclicBarrier forces a fixed number of threads to wait until they reach a common execution point.Given the following classpublic class Escape { static class Task implements Runnable { int i; CyclicBarrier cb; public Task(int i, CyclicBarrier cb) {this.i=i; this.cb=cb;} @Override public void...
Monday, May 15, 2023
Reduce technical debt by valuing comments as much as code
Good comments help maintainers understand your coding decisions.Comments have long occupied a distinctly secondary place in the output of developers. Comments are so secondary, and so undervalued, that in today’s code they appear infrequently except as routine copyright and licensing headers at the top of files. This is...
Friday, May 12, 2023
The hidden and not-so-hidden gems in Java 20
See the preview and incubator JEPs in Java 20, as well as many smaller enhancements, bug fixes, and deprecations.March 2023 marked the latest feature release of the Java platform, which was delivered on time through the six-month release cadence as Java 20. Like Java 19, which became generally...