To create a object of 'FileInputStream', we have three different ways. (i.e. three different constructors available). We can create by passing a file name , i.e. full path of the file (e.g. C://filename.txt ) or by passing a 'File' object or by passing a 'FileDescriptor' . In this example, I will show you by passing a 'File' object to the constructor.
ReadLet's say you have a program that takes input from the user and finds out the reminder of 100/(user-input-number).
ReadEvil number is a non negative number that has even number of 1 in its binary representation. E.g. Binary representation of 5 is 101 . It has two 1 in binary form. So it is an evil number.
ReadIn this example , we will learn how to find difference between two dates in Java 8. Date difference is required to find the age of a person , to find how many days/months/years for a specific date etc. In this tutorial, I will show you how to find the difference between two dates in Java 8. Java 8 introduced one new class called 'LocalDate' .
ReadJava program to calculate the discount price and the final price of a product in 3 different ways. We will learn how to calculate the discounted price with user input values with different methods and classes.
ReadIn this tutorial, we will learn how to copy a file in java . In the example explained below , we are showing one 'pdf' file to copy and create a different file in the same location.
ReadIn this tutorial, I will show you how to find the total number of divisors for a number starting from 1. Let's move through the steps first :.
ReadIn this tutorial, we will learn about while and repeat-while loops in swift. For both cases, I have added one example :.
ReadA Floyd triangle is a right angled triangle that is created by using increasing numbers. For example , following is a Floyd triangle of height 6 :.
ReadInfinite loop means a loop that never ends. In this tutorial, I will show you how to write an infinite loop in Java using for and while loop.
Read