If you’re working with Spring, check out "REST With Spring":

>> CHECK OUT THE COURSE

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 – To and From InputStream
  5. Java IO – To and From Reader

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

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 – to and from InputStream

Let’s now cover the basic conversions – to and from an InputStream:

4.1. From InputStream

4.2. To InputStream

5. Java IO – to and from Reader

Next – basic conversions to and from a Java Reader:

5.1. From Reader

5.2. To Reader

7. Java NIO

>> Introduction to the Java NIO2 File API

>> Java NIO2 Path API

>> Introduction to the Java NIO Selector

7. 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

8. 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.

The new Certification Class of "REST With Spring" is finally out:

>> CHECK OUT THE COURSE

  • 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.
    Thanks
    Deepak

    • 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,
      Eugen.

    • drumdumdum

      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 string is the same string as any pre-existing literal string with the same contents.