I just announced the new Spring 5 modules in REST With Spring:


This tutorial series focuses on core Java – “Back to Basics”. We’re going to cover Java Collections and Java IO:

  1. Core Java
  2. Java Collections
  3. Java IO – Working with Files
  4. Java IO – Conversions

1. Core Java

>> Java 8 – Powerful Comparison with Lambdas

>> Java – Random Long, Float, Integer and Double

>> Java – Generate Random String

>> Java Timer

>> Java Scanner

>> Java – Try with Resources

>> Java – Round Decimal Numbers

>> Java – Guide to UUID

>> Java – Changing the Order in a Sum Operation Can Produce Different Results?

>> Java – Comparing getPath(), getAbsolutePath(), and getCanonicalPath() in Java

>> Java – How to Add a Single Element to a Stream

>> Java – ClassNotFoundException vs NoClassDefFoundError

>> Java – Iterating over Enum Values

>> Java – Guide to Synchronized Keyword

>> How to Remove the Last Character of a String?

>> Java – Split a String

>> Java – The StackOverflowError

>> Java – Double Brace Initialization

>> Java – Count Occurrences of a Char in a String

>> Java – Introduction to JDBC

>> Java – Difference Between Wait() and Sleep()

>> Java – Converting a Stack Trace to a String in Java

>> Java – Period and Duration in Java

>> Java – Guide to the StringTokenizer

2. Java Collections

>> Partition a List in Java

>> Immutable ArrayList in Java

>> Removing all nulls from a List in Java

>> Removing all duplicates from a List in Java

>> A Guide to the Java LinkedList

2.1. Conversions Between Collections

Let’s go over the basic ways to convert to and from the common collection types:

3. Java IO – Working with Files

Let’s start with the basic File operations:

>> Java – Reading a Large File Efficiently

>> Java – Rename or Move a File

>> Java – Create a File

>> Java – Delete a File

>> Java – Write to File

>> Java – Read from File

>> Java – Directory Size

4. Java IO – Conversions

5. Java NIO

>> Introduction to the Java NIO2 File API

>> Java NIO2 Path API

>> Introduction to the Java NIO Selector

6. Advanced Java

>> Working with Network Interfaces in Java

>> Convert Hex to ASCII in Java

>> How to Print Screen in Java

>> A Guide To UDP In Java

>> How to Get a Name of a Method Being Executed

>> How to Find all Getters Returning Null

>> Changing Annotation Parameters At Runtime

>> Merging Streams in Java

>> Map() and Flatmap() Difference in Java

>> How to Get the Last Element of a Stream in Java?

>> Converting String to Stream of chars

>> How to get all Dates Between Two Dates?

>> Guide to Escaping Characters in Java RegExps

>> Introduction to Java Serialization

>> Guide to the Java Phaser

>> Call Methods at Runtime Using Java Reflection

>> Guide to DelayQueue

>> Guide to CopyOnWriteArrayList

>> Dynamic Proxies in Java

>> Using Java MappedByteBuffer

>> LongAdder and LongAccumulator in Java

>> Guide to the ConcurrentSkipListMap

>> Guide to the Java TransferQueue

>> A Guide to Java SynchronousQueue

>> Guide to sun.misc.Unsafe

>> An Introduction to ThreadLocal in Java

>> Strategy Pattern

>> Weak Hashmap

>> Blocking Queue

>> Priority Blocking Queue

>> Concurrent Map

>> Future

7. Tracking Java Development

>> Java 8 – News

>> Java 9 – News

>> Best Java Blogs

There we go – the “Back to Basics” Java series, covering basic operations with collections and IO.

I just announced the new Spring 5 modules in REST With Spring:


newest oldest most voted
Notify of
Deepak Pandey

Hey Eugen. when we use new operator to create a String object.
i.e String obj1=new String(“abc”);
It will create object in heap , but is it create an object in String pool also or copy the value in string pool.
Please elaborate the process.

Eugen Paraschiv

Hey Deepak. Simply put, when you instantiate the String object via the constructor, you’re creating a new object on the heap. When you’re using the String literal, you’re referencing it in the String pool. That distinction will determine the equality of these references.
Of course there are a lot of solid tutorials online that go into the details of how that works, so I’d definitely recommend doing a search and reading through some of these – it’s worth taking a bit of time to get the basics nailed down.
Hope it helps. Cheers,

See Example 3.10.5-1. String Literals in Java language specification. Literal strings within the same class (§8) in the same package (§7) represent references to the same String object (§4.3.1). Literal strings within different classes in the same package represent references to the same String object. Literal strings within different classes in different packages likewise represent references to the same String object. Strings computed by constant expressions (§15.28) are computed at compile time and then treated as if they were literals. Strings computed by concatenation at run time are newly created and therefore distinct. The result of explicitly interning a computed… Read more »