JavaQuick Tip: How to Remove a System Property in Java

Quick Tip: How to Remove a System Property in Java

Java Developer Tutorials

In this Java programming quick tip tutorial, developers will learn how to remove a system property using the System.getProperty method. This technique is illustrated in the Java code example below:


import java.util.*;

public class DoubleBraces {
	public static void main(String[] args) 
		DoubleBraces doubleBraces = new DoubleBraces();

	private void proceed()  
		//Ideal way of initializing the arrayList
		List arrayList = new ArrayList();
		//Initializing using the double braces way {{ }}
		List arrayList2 = new ArrayList() {{
		System.out.println("ArrayList initialized the ideal way: " + arrayList);
		System.out.println("ArrayList initialized the double braces way: " + arrayList2);



Running this code example will result in the following output:

[root@mypc]# java DoubleBraces
ArrayList initialized the ideal way: [One, Two, Three]
ArrayList initialized the double braces way: [One, Two, Three]

Read more Java programming and development tutorials.

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Latest Posts

Related Stories