We can use ternary operator in java to find singular or plural value as below. Here basket is a l ... Read More
Below is an example of writing to the text file using FileWriter class Note that we have added ... Read More
We have seen in out Sets example that if we add two user defined class objects of class Planet to th ... Read More
* Package names should always be lowercase. If domain name contains a java keyword or contains a - ... Read More
We know that we can use group patterns to print the occurence of a particular pattern in a String. W ... Read More
If we want to print only files and not the directory we can do something like below We make a fi ... Read More
* Let see how to copy file named File1.txt from Dir3 directory in Dir2 to a folder named Dir3 wihin ... Read More
Four main concepts of Java or any other Object oriented programming language are 1. Abstraction ... Read More
We can even use Buffered writer . File writer writes data to Buffered writer and the buffered write ... Read More
Code to move,rename and delete a file is below. ``` try{ //To move a file from one folder t ... Read More