Byte Streams in Java

In java programming, to perform input and output of 8-bit, Byte stream is used. Most common byte streams classes are, FileInputStream and FileOutputStream. FileInputStream : FileInputStream is used for reads one byte at a time . FileOutputStream : FileOutputStream is used for writes one byte at a time Writing Bytes Example: Write a program, to write a bytes to … Read more

Prime number program in java using while loop

Here we generate and check prime number using while loop in java so that we titled this prime number program in java using while loop. 1 What is a Prime Number A prime number is a whole number that has only two factors 1 and the number itself. For example, 23 is a prime number, … Read more

Simple Calculator in Java Applet

Java Applet provides a GUI way to create a program and its interface, Here we are creating Simple Calculator in Java Applet with GUI and its processing. As we have already learned about applet and applet life cycle. Here we have discussed two simple calculator programs using the applet. 1 Simple calculator program in java … Read more

Concatenate & Buffer File in Java

Here we will concatenating and store buffering files in java using BufferedInputClass and BufferedOutputClass. Concatenate: It is possible to concatenate two or more files and save in a different file. In java, by using SequenceInputStream class we can concatenate two or more files. Buffer Files: In java, we can create a buffer to store temporary … Read more

JTable Pagination in Java JDBC and MySQL Database

Here we will see how to develop JTable Pagination in java. We will use JDBC prepared statement and MySQL Database. We used NetBeans IDE and Jdk 1.8 to develop this project. Our Project Structure is as below To develop this project we used Book Example. Project Development Steps are 1 Create Table in MySQL Database … Read more

Gson parse json array with example

Gson parses JSON array meaning to Parsing JSON array with Google Gson library. Follow these steps to read JSON Array To read jsonString as an array we use the following syntax Gson gson=new Gson(); ElementType [] refVar=gson.fromJson(jsonString,ElementType[].class); To read jsonString as List TypeToken is used to find the type of class List eList=(List)gson.fromJson(reader, new TypeToken(){}.getType()); … Read more

Thread isAlive() and join() Methods in Java

Here we will discuss the Thread isalive() and join() method in java There are two ways to determine whether a thread has finished or not. Read More: Thread Concepts Thread Life Cycle in JavaMultithreading in Java Thread Creation Method Use ExampleThread Priorities in JavaMain Thread in JavaThread Yield method in JavaThread Synchronization in JavaThread suspend() … Read more

User Defined exception in Java | Java custom exception examples

In Java programming, it is possible to create our own exceptions and such exception are called user-defined exceptions in Java. The exception class is a predefined class. Any user-defined exception created by us must be a subclass of the predefined Exception class and created by extending the Exception class. Read More What is user defined … Read more

Java string replace:string character whitespace vowel regex

Here we will see Java string replace examples with replacing the string, replacing characters, replacing whitespace vowels, and using a regular expression to replace string and substring. Java string replace Example: use of replace() Java String replace() is used to replace substring in given string.

In this example, Joker is replaced with Poker and … Read more

Employee details program in java using class and object

Employee details program in java as below. Here two classes are created Details of these two classes are as below java program for employee details using class and object employee class in java : Employee.java This class contains various fields of employees like id, fname, lname, address etc. Its corresponding getter and setter method are … Read more