Core Java Archive

Factorial of a number

The demo illustrates finding the factorial of a number, accepted from a user on console. We need to create two classes, Number and Test. The class Number contains the method ‘factorial‘ which can be accessed from the static main method by creating the object of the Number class. [crayon-5b540add6f59d722754793/] I hope everything is pretty much clear.

File Handling in Java

Why Byte Stream? Programs use byte streams to perform input and output of 8-bit bytes All byte stream classes are descended from InputStream and OutputStream There are many byte stream classes – FileInputStream and FileOutputStream They are used in much the same way; they differ mainly in the way they are constructed When Not to Use Byte Streams? Byte Stream represents a

Java Development process at a glance

The processes involved between the moment you write a program to the moment you execute it, is not as straightforward as one would expect. Here, in this post, we will try unwinding it a little bit. Suppose you wrote some java program say,, which means that it if it contains any public class, the name

JVM JRE and the JDK

JDK is the Java Development Kit, JRE stands for the Java Runtime Environment while JVM stands for the Java Virtual Machine. As my past experience, I always used to get confused among these. So let’s make sure, how I write will never make us forget any of this again. JVM So, JVM is the prime abstract machine

Playing with DATE in java

Seeing many novice getting stuck working with Java Date, I prepared a single file, with all basic possibilities to manipulate a Date instance. Here you will figure out the similarities and the difference in manipulating the java.sql.Date and java.util.Date instances. Hoping that this would help my readers as well, following is the java code for

Get more stuff like this
in your inbox

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.