6 example to declare two dimensional array in Java

Declaring a two-dimensional array is interesting in Java as Java programming language provides many ways to declare a 2D array and each way have some special things to learn about. For example, It's possible to create a two-dimensional array in Java without specifying the second dimension, sounds crazy right? but it's possible because two-dimensional array in Java is nothing but an array of array. You can even create a two-dimensional array where each subarray has different length or different type, also known as a heterogeneous array in Java. Some of the ways described here also apply how you to declare one-dimensional array e.g. changing the place of square brackets and it has implication on any other variables declared in the same line.

How to remove all special characters from String in Java

You can use regular expression and replaceAll() method of java.lang.String class to remove all special characters from String. A special character is nothing but characters like ! #, % etc. Precisely, you need to define what is a special character for you. Once you define that you can use a regular expression to replace those character with empty String, which is equivalent to removing all special characters from String. For example, suppose, your String contains some special characters e.g. "Awesome!!!" and you want to remove those !!! to reduce some excitement, you can use replaceAll("!", "") to get rid of all exclamation mark from String. Similarly, if you String contains many special characters, you can remove all of them by just picking alphanumeric characters e.g. replaceAll("[^a-zA-Z0-9_-]", ""), which will replace anything with empty String except a to z, A to Z, 0 to 9,_ and dash. Let's see couple fo examples to remove all special characters from String in Java.

Introduction of How Android Works for Java Programmers

Android development is a current buzz in Java programming world. It's the Android, which keeps Java in the forefront of the last couple of years. Now, How important is to understand or learn Android for Java programmers? Well, it depends on, if you like application development and want to reach a mass, Android offers that opportunity to you. Millions of Android phones are available and they are keep increasing, with pace, much higher than iPhone or iOS. What all these means is, it does make a lot of sense to learn Android programming for Java programmer, and this article is about that, but this is also a one of the good reason to learn Java programming. This tutorial will give you a basic idea of How Android works? not detailed but a good overview.