In this tutorial, we will learn how to print the last modified date and time of a file in Java. For this, we will first create one 'File' object. To create one 'File' object, pass the file's location to the constructor. If you want to get the full path of a file, open one terminal and drag-drop one file on the terminal. It will print its full path.
ReadAmerican Standard Code for Information Interchange or ASCII code links an integer value to a symbol like letter, digit , special character etc. In ASCII 7 bits are used to represent a character. From 0 to 127, each number can be represent by a character. In this tutorial, we will learn how to print ASCII value of an integer.
ReadIn this tutorial, we will learn how to find out the top 3 numbers in an array. Algorithm used in this program is as below :.
ReadIn this example, we will learn how to delete a file in Java. In the below program, the full path of the file is stored in 'fileName' variable. First we create one 'File' object using 'File(fileName)' constructor. Then we will delete that file using 'delete()' function. It will return 'true' if the file is deleted successfully. 'false' otherwise.
ReadIn this tutorial, we will learn how to calculate the sum of the series 1^2 +2^2 +3^2 +4^2 + ..... +n^2 ( where n can be any number ) and print out the series with the sum as well.
ReadIn this tutorial, we will learn how to find the area and also perimeter of an equilateral triangle in Java.
ReadIn this example, I will show you one basic Java File I/O operation - "Reading the contents" of a text file. We will use 'BufferedReader' and 'FileReader' class in this example. What these classes are used to do mainly ?
ReadBubble sort repeatedly compares each elements in an array. We will traverse the array from the first element and check if it is greater than the second. If it is greater than the first, we will swap the first element with second. Then we will check the second element with third etc. This swapping will continue until no swap is needed.
ReadBMI or body mass index can be calculated by taking the weight in pounds and height in inches or by taking the weight in kilograms and height in meters. We have to use a different formula for both cases. In this example, we will learn how to do the calculation by using any of these two different approaches.
ReadIn this example, I will show you how to convert all characters of a string to uppercase or lowercase. First we will take the input string from the user using 'Scanner' class and then convert it to upper and lower case using following two methods :.
Read