Tag: guide
How to Check if Integer is a multiple of a number in Java?
If you want to check if the integer value is a multiple of a number in Java , you can use the modulus (%) operator . If you get the result as zero , then it is considered as multiple of a number. How to Check if Integer is a multiple of a number in Java? Below is a sample code snippet demonstrating the usage…
How to append an array to another in JavaScript ?
In JavaScript , you may want to append one array to another array(s) to combine their elements resulting in to a single array. How to append an array to another in JavaScript ? You can use the concat method of JavaScript to achieve the same. Below is a sample code snippet demonstrating the usage of the concat method of array in JavaScript to combine multiple…
Java – How to declare Hexadecimal literal ?
Problem statement You need to declare an Hexadecimal literal in Java and display the result on a console window. Solution Hexadecimal numbers can contain numbers from 0-9 as well as characters A-F where A-F represents 10-15. You can prefix the numbers with 0X to denote it as hexa decimal number as shown below. The output of the above program will be 10 21
SQL Server 2014 Tutorial – Personalize SQL Management Studio
Problem Statement You need to personalize SQL Server Management Studio. Solution There are various personalization options available for the SQL Server users in the SQL Management Studio. For example, if you want the Object explorer to be place on a different position instead of showing it in the left side of the SSMS, you can just move it by clicking it on the title bar…
ElasticSearch – How to Install ElasticSearch ?
Problem Statement You need to download , install and Elastic Search on Windows and Mac OS X machines. Solution You can download ElasticSearch which is available in various formats like Zip , Tar.gz from https://www.elastic.co/downloads/elasticsearch . The installation is pretty simple and infact you dont need to do anything special to install ElasticSearch on your machine. You need to extract or uncompress the file. Note…
Java – How to document your code ?
Problem Statement You need to document your java classes so that it helps in maintenance. Solution Use Javadoc and place comments before any method , field or class to document. Just enter /** to start writing the comments using javadoc. The subsequent lines needs to begin with * and end the comment section with */ Below is a sample code demonstrating the usage of the…
Java How to – Get Environment Variables
Problem Statement You need to programmatically get the values of the environment variables from your java program. Solution Use java.lang.System.getenv method to get the environment variables from your java program from Java JDK 1.5 and higher version. You can pass the “PATH” as parameter to the method to retreive the path from the environment variable. When no arguments are passed, it returns all the environment…
Java – How to Check if the Double value is not a number ?
Problem Statement You need to find out if the given double value is not a number in Java. Solution Use the method isNaN() defined in the Double class to find out if the given number is not a number in Java. The output of the above program is Abundantcode.com Java Tutorials true
Java – How to round a BigDecimal value in Java ?
Problem Statement You need round the BigDecimal value in your Java program. Solution Use the setScale method that is defined in the BigDecimal to round the value of the BigDecimal. You can also set the parameters like BigDecimal.ROUND_HALF_UP etc to the method. Output of the above program is Abundantcode.com Java Tutorials 10102.16