The program arguments passed at launching the Java program are called command line arguments. While launching the program we can pass additional arguments (no limit of numbers of arguments).
Recursion is referred to a programming style where a method invokes itself repeatedly until a certain predefined condition is met. Such method calls are also called recursive methods.
Java naming conventions are sort of guidelines which application programmers are expected to follow to produce a consistent and readable code throughout the application. If teams do not not follow these conventions, they may collectively write an application code which is hard to read and difficult to understand. Java heavily uses CamelCase notations for naming […]
this and super are reserved keywords in Java. this refer to current instance of a class while super refer to the parent class of that class where super keyword is used.
Java strictfp modifier ensures that all floating-point operations across different JVMs will provide consistent and same result as predicted by IEEE 754.
In this Java tutorial, learn about difference between final, finally and finalize in detail. In short, final is a keyword, finally is a block and finalize is a method. They have their own very specific purpose in Java programs.
Java boolean keyword is used to declare a variable as a boolean type which represents only one of two possible values i.e. either true or false.
Java assert keyword is used to create assertions in Java, which enables us to test the assumptions about our program. For example, an assertion may be to make sure that an employee’s age is positive number. Each assertion contains a boolean expression that you believe will be true when the assertion executes. If it is […]
Java abstract keyword can be used with classes and methods; but not with variables. abstract is non-access modifier which helps in achieving abstraction.
Java application code is normally executed sequentially from top to bottom in the order that the code appears. To apply business logic, we may need to execute code on conditional basis. Control flow statements helps in this conditional execution of code blocks. All control flow statements are associated with a business condition – when true, […]
In this Java tutorial, we will learn about Java Tuple – a generic data structure and how we can use tuples in a Java program. Tuple, by default, are not present in Java programming language as data structure, so we will use one nice third-party library javatuples for it. Table of Contents 1. What is […]
Java hashCode() and equals() methods. Learn contract between hashCode and equals methods. How to correctly override both methods and best practices.
Learn about Java wrapper classes, their usage, conversion between primitive and object; and autoboxing and unboxing with examples. 1. Java Wrapper classes Java provides type wrappers, which are classes that encapsulate a primitive type within an object. In Java, we have 8 primitive data types. A wrapper class wraps (encloses) around a data type and […]
Learn everything about Java comments, types of Java comments, Javadoc tool, performance impact of comments and best practices to follow. 1. Why write Java comments? Java comments, as the name suggests, are notes you write between the programs for various reasons. For example, you may write comments to – write information or explanation about the […]
Learn about Java variables, types of variables in Java, example of how to declare variables and best practices for variables naming convention. The Java programming language uses both “fields” and “variables” as part of its terminology. Fields refer to variables declared outside methods, and variables are referred to declarations inside methods, including method arguments. 1. […]
JDK, JRE and JVM is very common words when developers talk about java applications and their development environments. Let’s find out the differeneces between these words.
Learn to compare double or compare float to avoid unexpected results caused by minor rounding errors during conversions at lower level program execution.
Static keyword in java can be applied on variables, methods, blocks, import and inner classes. Learn the effect of using static keyword in detail.
Use given syntax examples for setting CLASSPATH for any java application runtime, in windows and linux environments.
Java maintains a set of system properties for its operations. Each java system property is a key-value (String-String) pair such as “java.version”=”1.7.0_09“. You can retrieve all the system properties via System.getProperties() or you can also retrieve individual property via System.getProperty(key). Please note that Access to system properties can be restricted by the Java security manager […]