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

MySql dump using java

A MySQL dump, also known simply as a “dump,” is a process of exporting or backing up the data and structure of a MySQL database into a file. This file contains a snapshot of the database’s contents at a specific point in time, making it useful for various purposes, such as: To create a MySQL … Read more

how to return array, arraylist, object from a method in java

In Java we can create methods to do specific work and many times we have to return results from java method. A java method can return any datatypes or object type from method. 1 Return primitive datatypes from method A Returning int long float double values from a java method A. Return a integer value … Read more

Jtable in Java Swing Example defaulttablemodel cell color

JTable in Java is a swing component, that is used to show data in a two-dimensional Grid. Here we will discuss JTable Java Swing Example with various parameters It is used to display and edit data in cell format in table How to create login form in java swing Constructors of JTable in Java Swing … Read more

Find out Duplicate Number between 1 to n numbers in java

Find out duplicate number between 1 to n numbers in java is generally ask in interviews. Here we are going to find a duplicate number between 1 and n. n is any user given number. We have to check which number is duplicate. For example In above figure first row contains number 12 two times … 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

If else nested and ladder if else statement in Java

If else is used to select a set of statements based on condition. If the condition is true then the statement associated with if is executed, otherwise else part is executed. It can also be used without else. If , if else, switch are conditions statements that Java supports. If else has variations it can … Read more

Displaying file properties

Displaying file properties can be easily done in java package io; import java.io.File; import java.io.IOException; public class FileOrDir { public static void main(String[] args) { File f = new File(“D:\\first.txt”); File f1 = new File(“D:\\second.txt”); if (f.exists() == false) { System.out.println(“File or Directory does not exists”); } if (f.isDirectory()) { System.out.println(“This is a directory”); } … Read more

Break Statement in Java

Break statement can use in looping statement (for,while,do while) and also in switch case. Break statement is used to terminate the execution of the current loop or current switch. Break statement is also used to the execution of label. Break statement is used in two variation 1. Break 2. Break label 1. Break Example

Read more