We write codes that create Java objects from Java classes. These can have properties and behaviors. Properties are data with names; while, behaviors are the actions an object can perform on its properties. Consider the following Java class without properties
Chapter 8: Java Primitives in The OOP World
Java primitives are predefined basic data types that exist in the Java programming language. We do not need to create them as we would with our custom Java classes. What Are Basic Data Types in Java? Java primitive types hold
Java 9 Stream filter, takeWhile, dropWhile methods
This post demonstrates how to use the new methods – takeWhile and dropWhile – of the Stream interface in Java 9 Jigsaw. We’ll touch briefly on Stream.filter(Predicate p) just to get comfortable before trying out the new methods.
Java – 3 ways to implement a Generic Interface
A Generic Interface is an interface that makes use of formal type parameters. It uses Generics. There are 3 ways to implement a Generic Interface.
Java Formal Type Parameter Methods We Can Invoke
With Java Generics, we name Java Formal Type Parameter T, E, K, and V conventionally. If an instance of a Format Type Parameter, what available methods we can invoke on them? Java Formal Type Parameter is Object Formal Type Parameters
Java – Beyond String Pool
The String Pool is a location in the Java Virtual Machine (JVM) that collects all the literal Strings from your codes. Java keeps unique Strings for reuse.
Array-backed Lists in Java
In Java, there are these array-backed lists that are generated when you convert arrays to lists using Arrays.asList(…). The list and the array objects point to the same data stored in the heap. Changes to the existing contents through either the list or array result to changing the same data.
Java Primitive Float And Double – What’s the difference?
Any floating-point literal in Java is by default of a double type.
Java – How to pass argument string with spaces to Java
The way you run your application in Java is by invoking java followed by the class name (without the .class extension).