• Home
  • Terms and Condition
  • Contact Us
  • Privacy Policy

Top 43 Java IO and File System Interview Questions with Answers for 1 to 3 Years Experienced

By javin paul / core java
Top 43 Java IO and File System Interview Questions with Answers for 1 to 3 Years Experienced

Good knowledge of Java IO API is important for any Java developer but many of them barely pay attention to Java IO and NIO API, and that's why they often struggle during Java interviews when a question related to Input-Outpu…

Read more

How to work with Files and Directories in Java? Example Tutorial

By javin paul / core java
How to work with Files and Directories in Java? Example Tutorial

The File API is one of the important parts of any programming language or API and even though Java's file API both new and old, is powerful, they are not intuitive enough compared to other languages like  Python . Apart from…

Read more

How to lock a File before writing in Java? Example

By javin paul / core java
How to lock a File before writing in Java? Example

A file is one of the oldest ways to store data and share data but if you are working in a shared file i.e a file that can be read or write by multiple readers and writers, you need to make sure that the file is locked be…

Read more

How to create a ZIP File in Java? ZipEntry and ZipOutputStream Compression Example

By javin paul / core java
How to create a ZIP File in Java? ZipEntry and ZipOutputStream Compression Example

Since compressing and archiving old log files is an essential housekeeping job in any Java application environment, a Java programmer should know how to compress files in .zip format and then how to read them programmatically …

Read more

How to read a text file into ArrayList in Java? Examples

By javin paul / core java
How to read a text file into ArrayList in Java? Examples

Prior to Java 7, reading a text file into an ArrayList involves a lot of boilerplate coding, as you need to read the file line by line and insert each line into an ArrayList , but from Java 7 onward, you can use the utility met…

Read more

3 ways to Copy a File From One Directory to Another in Java, Examples

By javin paul / core java
3 ways to Copy a File From One Directory to Another in Java, Examples

Even though Java is considered one of the best feature-rich programming languages, until Java 7, It didn't have any method to copy a file from one directory to another directory. It did have the java.io.File class, which pr…

Read more

How to read a text file as String in Java? Example

By javin paul / java io tutorial
How to read a text file as String in Java? Example

There was no easy way to read a text file as String in Java until JDK 7 , which released NIO 2. This API now provides a couple of utility methods that you can use to read the entire file as String e.g. Files.readAllBytes() retu…

Read more

How to load data from CSV file in Java - Example

By javin paul / core java
How to load data from CSV file in Java - Example

You can load data from a CSV file in a Java program by using BufferedReader class from the  java.io package. You can read the file line by line and convert each line into an object representing that data. Actually, there are …

Read more

How to write to File in Java using BufferedWriter [Example]

By javin paul / java io tutorial
How to write to File in Java using BufferedWriter [Example]

You can use either OutputStream or Writer class in Java to write data to a file in Java. For example, you can use a combination of FileWriter and BufferedWriter to write text content into a text file in Java. If you want to wr…

Read more

How to append text to existing File in Java? Example

By javin paul / java io tutorial
How to append text to existing File in Java? Example

In the last tutorial, you have learned  how to write data to a file in Java , and in this tutorial, you will learn how to append text to a file in Java. What is the difference between simply writing to a file vs appending data t…

Read more

Difference between FileReader vs FileInputStream in Java? Answer

By javin paul / core java
Difference between FileReader vs FileInputStream in Java? Answer

Even though both FileReader and FileInputStream are used to read data from a file in Java, they are quite different. The main difference between the FileReader and FileInputStream is that one reads data from a  character str…

Read more

3 Examples to Read FileInputStream as String in Java - JDK7, Guava and Apache Commons

By javin paul / Code Example
3 Examples to Read FileInputStream as String in Java - JDK7, Guava and Apache Commons

Java programming language provides streams to read data from a file, a socket and from other sources e.g. byte array, but developers often find themselves puzzled with several issues e.g. how to open connection to read data, how…

Read more

Java FileReader + BufferedReader Example

By javin paul / java io tutorial
Java FileReader + BufferedReader Example

There are multiple ways to read a file in Java e.g. you can use a Scanner as we have seen in the last example , or you can use the BufferedReader class. The advantage of using a BufferedReader to read a text file is speed. It a…

Read more

10 Examples of print(), println() and prinf() methods In Java - PrintStream

By javin paul / java
10 Examples of print(), println() and prinf() methods In Java - PrintStream

Hello guys, if you are working in Java or just started with Java then you have must come across statements like System.out.println("Hello world") to print something on console or command prompt . This is actually the f…

Read more

Top 12 Java NIO Interview Questions Answers for 5 to 10 Years Experienced Programmers

By javin paul / interview questions
Top 12 Java NIO Interview Questions Answers for 5 to 10 Years Experienced Programmers

Hello guys, I have been sharing a lot of Java interview question in this blog and so far I have shared Java interview questions on Core Java , Collections , Java 8 , Multithreading , design patterns , Garbage Collections , Sprin…

Read more

How to Create File and Directory in Java with Example

By javin paul / core java
How to Create File and Directory in Java with Example

Many beginners confused with the fact that the same class  java.io.File  is used to create both file and directories in Java . I agree, this is not very intuitive and junior developers probably start looking for a class called  …

Read more

2 Ways to Read a Text File in Java? BufferredReader and Scanner Examples

By javin paul / core java
2 Ways to Read a Text File in Java? BufferredReader and Scanner Examples

You can read a text file in Java by using either Files , BufferedReader  or Scanner class. Both classes provide convenient methods to read a text file line by line e.g. Scanner provides nextLine() method and BufferedReader pro…

Read more

How to Read User Input and Password in Java from command line? Console Example

By javin paul / core java
How to Read User Input and Password in Java from command line? Console Example

Hello guys, if you are wondering how to take user input from command prompt in Java like username and password then don't worry. Java provides several utilities like Scanner  and BufferedReader to read input from command prom…

Read more

How to check if File is Empty in Java? Example Tutorial

By javin paul / core java
How to check if File is Empty in Java? Example Tutorial

One of the readers of my blog Javarevisited emailed me yesterday about how to check if a file is empty in Java and that's why I am writing this post to show that using an example. The common approach for checking if a file i…

Read more

5 Difference between BufferedReader and Scanner class in Java? Example

By javin paul / core java
5 Difference between BufferedReader and Scanner class in Java? Example

Hello guys, welcome to my blog. Today, we'll discuss another interesting Java interview question, BufferedReader vs Scanner. It's not only important from an interview point of view but also to work efficiently with Java.…

Read more

Older Posts Home

Popular Posts

  • How to Find the Largest and Smallest of Three Numbers in Java? [Solved]
  • Top 10 Frequently asked SQL Query Interview Questions Answers
  • How to fix "class, interface, or enum expected" error in Java? Example
  • Top 21 String Programming and Coding Interview Questions With Solutions
  • How to fix java module error "Caused by: java.lang.reflect.InaccessibleObjectException: module java.base does not "opens java.util" to unnamed module"

Categories

  • .NET
  • abstract class
  • Affiliate marketing
  • After Effects
  • Agile
  • Amazon Web Service
  • android
  • Angular
  • Anonymous class
  • Ansible
  • apache camel
  • Apache kafka
  • Apache spark
  • app development
  • array
  • ArrayList
  • Artificial Intelligence
  • automation
  • aws
  • aws certification
  • Azure Certifications
  • backend development
  • bash
  • basics
  • beginners
  • best of java67
  • best practices
  • Big Data
  • binary tree
  • bit manipulation
  • Blockchain
  • BlockingDeque
  • books
  • Bootstrap
  • business analysis
  • C programming
  • C++
  • Career
  • ChatGPT
  • Chef
  • cloud certification
  • Cloud Computing
  • Code Example
  • codecademy
  • coding
  • coding exercise
  • Coding Problems
  • Comparator
  • computer science
  • Computer Vision
  • concurrency tutorial
  • ConcurrentHashMap
  • core java
  • core java interview question answer
  • course review
  • Coursera
  • courses
  • crontab
  • CSS
  • Cyber Security
  • Data Analysis
  • data science
  • data structure and algorithm
  • Data Visualization
  • database
  • datacamp
  • date and time
  • debugging
  • deep learning
  • default methods
  • design pattern
  • DevOps
  • DevSecOps
  • Distributed Systems
  • Django
  • docker
  • double
  • Drawing
  • dyanmic programming
  • dynamic Programming
  • eBooks
  • Eclipse
  • EJB
  • enum
  • equals
  • error and exception
  • Ethical hacking
  • Excel
  • exception
  • expressjs
  • Figma
  • Firebase
  • flatmap
  • float
  • Flutter
  • free resources
  • freelancing
  • fun
  • Fundamental
  • fundamentals
  • Game development
  • garbage collection
  • general
  • Generics
  • gifts
  • git and github
  • golang
  • Google Cloud Certification
  • Google Cloud Platform
  • Gradle
  • grails
  • graph
  • graphic design
  • grep
  • Groovy
  • gRPC
  • Hadoop
  • HashMap
  • HashSet
  • haskell
  • Hibernate
  • Hibernate interview Question
  • homework
  • HTML
  • HTTP
  • HttpClient
  • i
  • interface
  • Internet of Things (IoT)
  • interview
  • interview questions
  • IT Certification
  • J2EE
  • Jackson
  • java
  • Java 5 tutorial
  • java 7
  • Java 8
  • java 9
  • java basics
  • Java Certification
  • Java collection tutorial
  • java concurrency tutorial
  • java design pattern
  • Java Enum
  • Java file tutorials
  • Java Functional Programming
  • Java Installation Guide
  • Java Interview Question
  • Java interview questions
  • Java IO interview question
  • java io tutorial
  • java map tutorials
  • java modules
  • Java Multithreading Tutorial
  • Java networking tutorial
  • Java Operator tutorial
  • Java programming Tutorial
  • Java String tutorial
  • Java7
  • JavaScript
  • JavaScript Interview Question
  • JavaScript Tutorial
  • JDBC
  • JEE Interview Questions
  • Jenkins
  • JMS
  • JPA
  • jQuery
  • JSON
  • JSP
  • JSP Interview Question
  • JSTL
  • JUnit
  • JVM
  • Keras
  • keystore
  • Kotlin
  • kubernetes
  • lambda expression
  • Laraval
  • linked list
  • Linux
  • Log4j
  • logging
  • Lombok
  • LSAT
  • Mac OS X
  • machine learning
  • Mathematics
  • Matlab
  • Maven
  • MERN stack
  • Messaging
  • Microservices
  • Microsoft
  • Microsoft Azure Platform
  • Microsoft Excel
  • Microsoft Power BI
  • Mockito
  • MongoDB
  • MysQL
  • MySQL tutorial example
  • nested class
  • neural network
  • Next.js
  • NFT
  • NLP
  • Node.js
  • nslookup
  • object oriented programming
  • OCAJP
  • OCMJEA
  • OCPJP
  • offers
  • Oracle
  • Perl
  • personal development
  • Photoshop
  • PHP
  • pluralsight
  • PostgerSQL
  • postman
  • Powerpoint
  • programmers
  • programming
  • programming problems
  • Project Management
  • projects
  • Prompt Engineering
  • Python
  • Pytorch
  • Quarkus
  • questions
  • Queue
  • R programming
  • React
  • React Hooks
  • react native
  • Record
  • Recursion
  • Redux
  • regular expression example
  • REST tutorials
  • RoadMap
  • Ruby
  • Salesforce
  • SAT
  • Scala
  • Scala Interview Questions
  • Scanner
  • scripting
  • Scrum
  • Scrum Master Certification
  • Selenium
  • SEO
  • Serialization
  • Servlet
  • Servlet Interview Questions
  • Set
  • shell scripting
  • smart contracts
  • Snowflake SnowPro Certification
  • soft link
  • soft skills
  • software architecture
  • Solaris
  • Solidity
  • Sorting Algorithm
  • Spark
  • spring boot
  • Spring Certification
  • spring cloud
  • spring data jpa
  • spring framework
  • spring interview question
  • spring mvc
  • spring security
  • sql
  • SQL interview Question
  • SQL Joins
  • SQL SERVER
  • ssl
  • Static
  • Statistics
  • Stream
  • String
  • Struts
  • Swift
  • swing
  • switch case
  • system design
  • Tableau
  • Tailwind
  • TensorFlow
  • ternary operator
  • testing
  • thread
  • thread interview questions
  • Time series analysis
  • Tips
  • tomcat
  • tools
  • tree
  • TreeMap
  • troubleshooting
  • TypeScript
  • Udemy
  • UI and UX Design
  • UML
  • unit testing
  • Unity 3D
  • Unix
  • unreal engine
  • Video Editing
  • Vuejs
  • web design
  • web development
  • web scrapping
  • Web Service
  • Wix
  • xml
  • YAML

  • Home
  • About Us
  • Contact Us
  • Privacy Policy

Copyright ©2025 Soma Sharma