SlideShare a Scribd company logo
18 Most Important Java Interview Questions and
Answers
Define Synchronization in Java
Synchronization in Java is a process in which the accessibility of shared
resources are controlled by making use of multiple threads in such a way
that only a single resource could be accessed at one time. A shared object
could be modified using a single thread whereas another thread would be
involved in the process of updating or using the value of the object in
non-synchronized multi-threaded application.
What is meant by JVM and why Java is considered as a Platform
Independent Programming Language?
JVM otherwise known as Java Virtual Machine is considered as an
interpreter that is capable of accepting and executing the ‘Bytecode’.
Because Java works on the basis of ‘compile once, run everywhere’, it has
been termed as a platform independent language.
The sequential steps that give an insight in to the platform independent
characteristics are as follows.
• Non-executable codes known as ‘Bytecode’ will be provided as an
output by Java Compiler
• Bytecode is nothing but a set of highly optimized computer
instructions that could be executed by Java Virtual Machine
• The programs could be executed easily across a wide range of
platforms by means of translation in to bytecode. This is because all
that is required is a JVM being tailored for that particular platform.
• There could be a difference in configuration for different platforms
in JVM and the same set of bytecodes could be understood easily.
All this makes Java program a platform independent one.
Differentiate between JDK and JRE
This is a typical Java interview question that has confused most of the
Java developers and it is important for Java developers to understand the
difference between JDK and JRE which would help take their career to the
next level. JDK stands for Java Development Kit which is a comprehensive
package of software which can be used for creating Java based software.
On the other hand, JRE stands for Java Runtime Environment. It is
nothing but an implementation of Java Virtual Machine that is capable of
executing Java programs. Each of the JDK would be comprised of one or
more JRE’s in addition to different kind of development tools such as Java
source compilers, debuggers, development libraries and bundling as well
as deployment of tools etc.
What is the difference between Constructors, Copy Constructor
and Constructor Overloading in Java?
For beginners, Constructors is considered to be basics of OOPS.
Constructor – Creating an instance of a class remains the most important
objective of having Constructors. Whenever an object of a class has been
created, the constructors would be invoked. Some of the key
characteristics of Java Constructors are as follows.
• Constructors could be public, private and protected etc.
• Default no-argument constructor could not be used whenever a
constructor with arguments has been defined in a class.
• Whenever the classes are being instantiated, they would be called
only once.
• Constructors would have the same name as that of the class.
• Value is not returned and therefore they need not have to specify
the keyword void.
• Java helps in creating a so called default no-argument constructor
whenever a constructor for the class is not created.
Constructor Overloading – Constructor overloading can be defined as the
passing of various number as well as type of variables as arguments out
of which most of them are regarded as private variables of the class.
Copy Constructor – A type of constructor that is capable of constructing
the object of class from another object of the same class is defined as
Copy Constructor. The reference of its own class is considered as a
parameter by the copy constructor.
Define Java Exception Handling and differentiate between
Unchecked Exception, Checked Exception and Errors?
Exception is a method to point out the occurring of an abnormal condition
in Java. Exceptions are considered as objects in Java and whenever an
exception is thrown, the object is also thrown. It has to be understood
that it is not possible to simply throw any objection as an exception. The
throwable is considered as a base class for the entire family of classes
that has been declared in java.lang which your program can instantiate
and throw.
Unchecked Exception – It is inherited from RunTimeException and the
RunTimeException is treated differently by JVM as the application code is
not required to deal with them explicitly.
Checked Exception – It is basically inherited from the Exception-class. The
checked exceptions have to be handled by a client code either through a
try-catch clause or should be thrown for the Super class to catch the
same.
Errors – Errors are popularly thrown for problems that deserve more
seriousness. The problems usually include OutOfMemoryError or OOM that
is not that easy to handle as well as manage.
It is desirable to set aside some time in improving the Java skills as
exception handling requires some special attention while designing of
huge applications.
Mention the key differences between Byte Streams and Character
Streams
Most of the Java programmers are very much familiar with the file
operations. The list of file operations ranges from generating user reports,
sending of attachments through mails as well as filling out the data files
from Java programs. Having an in-depth knowledge regarding file
operations is very essential for Java developers who are dealing with Java
interview questions.
Byte Stream
It is used for the reading as well as writing of binary data. The byte
streams are used by programs for performing the byte input as well as
byte output. Performing InputStreams operations as well as
OutputStream operations means the presence of a loop that is capable of
reading the input stream as well as writing the output stream one byte at
a time. The buffered I/O streams could be also used for an overhead
reduction if any.
Character Streams
Character streams work along with characters other than bytes. Unicode
conventions are considered while storing the characters in Java. During
such type of storage, characters usually become platform independent,
program independent as well as language independent.
Differentiate between the functions of Over-Riding and Over-
Loading in Java?
It is regarded as an important aspect in Object-Oriented Programming
and the concepts as well as functionalities of Over-Riding and Over-
Loading in Java has to be understood by every Java programmer.
Over-Riding
It is a function type that occurs in a class that is inherited by another
class. The functions that are inherited from the base class are replaced by
means of an Over-Ride function. However it is implemented in such a way
that it is called even though an instance of its class is pretending to be
different type through polymorphism.
Over-Loading
Whenever multiple methods with the same name along with different
parameters are defined through an action, then it can be defined as
overloading. However it is not at all related to overriding or
polymorphism. Two mechanisms are usually used for overloading the
functions in Java. The two mechanisms include ‘varying the number of
arguments’ as well as ‘varying the data type’.
List the most common data types supported by Java
This is one of the most popular and fundamental questions that are asked
as part of Java interview questions.
The list of eight primitive data types supported by Java is as follows.
• Byte
• Short
• Int
• Long
• Float
• Double
• Char
• Boolean
What is the difference between Autoboxing and Unboxing?
Autoboxing is defined as the automatic transformation of primitive types
in to its object equivalents or wrapper types for making the compilation
easier. The automatic transformation is performed by a Java Compiler.
Unboxing can be defined as the automatic conversion of wrapper types in
to its primitive equivalent.
What are the key differences between interface and an abstract
class?
Abstract class is a partially implemented class by a programmer and it
could be comprised of more than one abstract techniques. However
interface is considered similar to an abstract class and it occupies the
same namespaces as that of classes as well as abstract classes. Therefore
it is not possible to define an interface with the same name as that of
classes. The interface is more of a fully abstract class. Similarly abstract
classes could be comprised of constants, members, defined methods and
method stubs at the same time interfaces consists of only constants as
well as method stubs. Methods of an interface should be defined as public
where as the methods of an abstract class can be defined with any
visibility.
Whether garbage collection is an automatic process?
Yes, garbage collection is an automatic process and it could be requested
by means of calling System.gc (). The immediate starting of Garbage
Collection however cannot be guaranteed by JVM. Garbage collection is
also considered to be the most relevant feature of Java and is also known
as automatic memory management. This is because the unused variables
or objects from the memory can be automatically removed by the JVM.
The object in the memory cannot be freed directly by the user program
whereas it is up to the garbage collector for automatically freeing the
objects that are no longer referenced by a program.
Define Memory Leak
Whenever an unreferenced object that is not of any use is still not
garbage collected and thereby still hangs around within the memory is
often referred to as a memory leak.
Define Instance Variables in Java
The variables that are defined at a class level are known as Instance
Variables. There is no need to initialize instance variables before making
use of them as it could be automatically initialized towards their default
values.
Differentiate between Path and Class-path
Both Path and Class-path are considered as operating system level
environment variables. Classpath is used for specifying the location .class
files whereas Path is used for defining where the executable files (.exe
files) could be used within the system.
Define Java Reflection
Java Reflection is commonly used by programs that require the ability to
examine as well as modify the runtime behaviour of applications that are
powered by the Java Virtual Machine.
When the interface or abstract class has to be used?
To declare the methods as well as members a class must have, Interface
is used. The methods listed by the interface have to be declared and
implemented by users implementing the interface. Abstract class is used
whenever users require a default implementation. Thus users can
implement any number of interfaces as they require, however they would
be able to extend only one class. Contract or Standard is defined by
Interfaces and those contracts or standard has to be followed during the
implementation of the interface.
What is the major difference between StringBuffer and
StringBuilder?
The most important difference between StringBuffer and StringBuilder is
that the StringBuffer is synchronized where as the StringBuilder is
unsynchronized. If the text could be changed and the accessibility is
possible only from a single thread, then it is desirable to make use of
StringBuilder as it is unsynchronized. At the same time if the text can
change and it has to be accessed from multiple threads, then it is
desirable to make use of StringBuffer as it is synchronous.
Does Java support Pointers?
Pointer can be defined as a reference handle towards a memory location.
If the pointer is not handled properly, it can result in memory leaks as
well as reliability issues. This is the main reason why the usage of
pointers is not supported by Java.

More Related Content

What's hot (19)

PDF
Introduction to java (revised)
Sujit Majety
 
PPTX
basic core java up to operator
kamal kotecha
 
PPTX
1 java programming- introduction
jyoti_lakhani
 
PPTX
Introduction to java
Veerabadra Badra
 
PPT
Introduction to Java Programming, Basic Structure, variables Data type, input...
Mr. Akaash
 
DOC
Grade 8: Introduction To Java
nandanrocker
 
ODP
Introduction To Java.
Tushar Chauhan
 
PPTX
core java
Roushan Sinha
 
PDF
Bn1005 demo ppt core java
conline training
 
ZIP
Introduction to the Java(TM) Advanced Imaging API
white paper
 
PDF
Java unit 1
Shipra Swati
 
PDF
Core java course syllabus
Papitha Velumani
 
PDF
Java notes
Manish Swarnkar
 
PPT
Java basic
Arati Gadgil
 
PDF
Core Java
Prakash Dimmita
 
PPTX
Introduction to Java Programming
Saravanakumar R
 
PDF
Basic java tutorial
Pedro De Almeida
 
Introduction to java (revised)
Sujit Majety
 
basic core java up to operator
kamal kotecha
 
1 java programming- introduction
jyoti_lakhani
 
Introduction to java
Veerabadra Badra
 
Introduction to Java Programming, Basic Structure, variables Data type, input...
Mr. Akaash
 
Grade 8: Introduction To Java
nandanrocker
 
Introduction To Java.
Tushar Chauhan
 
core java
Roushan Sinha
 
Bn1005 demo ppt core java
conline training
 
Introduction to the Java(TM) Advanced Imaging API
white paper
 
Java unit 1
Shipra Swati
 
Core java course syllabus
Papitha Velumani
 
Java notes
Manish Swarnkar
 
Java basic
Arati Gadgil
 
Core Java
Prakash Dimmita
 
Introduction to Java Programming
Saravanakumar R
 
Basic java tutorial
Pedro De Almeida
 

Similar to Java questions and answers jan bask.net (20)

PDF
20 most important java programming interview questions
Gradeup
 
PPTX
Introduction to Java.pptx sjskmdkdmdkdmdkdkd
giresumit9
 
PDF
Top 10 Important Core Java Interview questions and answers.pdf
Umesh Kumar
 
PDF
PJ_M01_C01_PPT_Introduction to Object Oriented Programming Using Java.pdf
projectfora2
 
PDF
Java chapter 1
Mukesh Tekwani
 
PDF
Top 371 java fa qs useful for freshers and experienced
Gaurav Maheshwari
 
PDF
Java Faqs useful for freshers and experienced
yearninginjava
 
PPTX
Power Point Presentation on Core Java For the Beginers
SHAQUIBHASAN2
 
PDF
Unit 1 Core Java for Compter Science 3rd
prat0ham
 
PPTX
Java programming language
SubhashKumar329
 
PPTX
JAVA AND OOPS CONCEPTS.pptx helpful for engineering
PriyanshuGupta101797
 
PPTX
JAVA PROGRAMMING-Unit I - Final PPT.pptx
SuganthiDPSGRKCW
 
PPT
Classes and Objects
vmadan89
 
PPTX
Java training in bangalore
zasi besant
 
PPT
A begineers guide of JAVA - Getting Started
Rakesh Madugula
 
PPTX
Unit1 introduction to Java
DevaKumari Vijay
 
PDF
Introduction to Java
Professional Guru
 
PDF
Java Interview Questions
Kuntal Bhowmick
 
PDF
1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf
10322210023
 
20 most important java programming interview questions
Gradeup
 
Introduction to Java.pptx sjskmdkdmdkdmdkdkd
giresumit9
 
Top 10 Important Core Java Interview questions and answers.pdf
Umesh Kumar
 
PJ_M01_C01_PPT_Introduction to Object Oriented Programming Using Java.pdf
projectfora2
 
Java chapter 1
Mukesh Tekwani
 
Top 371 java fa qs useful for freshers and experienced
Gaurav Maheshwari
 
Java Faqs useful for freshers and experienced
yearninginjava
 
Power Point Presentation on Core Java For the Beginers
SHAQUIBHASAN2
 
Unit 1 Core Java for Compter Science 3rd
prat0ham
 
Java programming language
SubhashKumar329
 
JAVA AND OOPS CONCEPTS.pptx helpful for engineering
PriyanshuGupta101797
 
JAVA PROGRAMMING-Unit I - Final PPT.pptx
SuganthiDPSGRKCW
 
Classes and Objects
vmadan89
 
Java training in bangalore
zasi besant
 
A begineers guide of JAVA - Getting Started
Rakesh Madugula
 
Unit1 introduction to Java
DevaKumari Vijay
 
Introduction to Java
Professional Guru
 
Java Interview Questions
Kuntal Bhowmick
 
1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf
10322210023
 
Ad

Recently uploaded (20)

PPTX
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PDF
Vani - The Voice of Excellence - Jul 2025 issue
Savipriya Raghavendra
 
PDF
Characteristics, Strengths and Weaknesses of Quantitative Research.pdf
Thelma Villaflores
 
PPTX
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
PPTX
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
PDF
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
PDF
Introduction presentation of the patentbutler tool
MIPLM
 
PPTX
Introduction to Indian Writing in English
Trushali Dodiya
 
PDF
Android Programming - Basics of Mobile App, App tools and Android Basics
Kavitha P.V
 
PPTX
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
PPTX
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
PDF
epi editorial commitee meeting presentation
MIPLM
 
PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PDF
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
PPTX
TRANSLATIONAL AND ROTATIONAL MOTION.pptx
KIPAIZAGABAWA1
 
PDF
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
PDF
Mahidol_Change_Agent_Note_2025-06-27-29_MUSEF
Tassanee Lerksuthirat
 
PPTX
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
PPTX
Controller Request and Response in Odoo18
Celine George
 
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
Vani - The Voice of Excellence - Jul 2025 issue
Savipriya Raghavendra
 
Characteristics, Strengths and Weaknesses of Quantitative Research.pdf
Thelma Villaflores
 
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
Introduction presentation of the patentbutler tool
MIPLM
 
Introduction to Indian Writing in English
Trushali Dodiya
 
Android Programming - Basics of Mobile App, App tools and Android Basics
Kavitha P.V
 
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
epi editorial commitee meeting presentation
MIPLM
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
TRANSLATIONAL AND ROTATIONAL MOTION.pptx
KIPAIZAGABAWA1
 
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
Mahidol_Change_Agent_Note_2025-06-27-29_MUSEF
Tassanee Lerksuthirat
 
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
Controller Request and Response in Odoo18
Celine George
 
Ad

Java questions and answers jan bask.net

  • 1. 18 Most Important Java Interview Questions and Answers Define Synchronization in Java Synchronization in Java is a process in which the accessibility of shared resources are controlled by making use of multiple threads in such a way that only a single resource could be accessed at one time. A shared object could be modified using a single thread whereas another thread would be involved in the process of updating or using the value of the object in non-synchronized multi-threaded application. What is meant by JVM and why Java is considered as a Platform Independent Programming Language? JVM otherwise known as Java Virtual Machine is considered as an interpreter that is capable of accepting and executing the ‘Bytecode’. Because Java works on the basis of ‘compile once, run everywhere’, it has been termed as a platform independent language. The sequential steps that give an insight in to the platform independent characteristics are as follows. • Non-executable codes known as ‘Bytecode’ will be provided as an output by Java Compiler • Bytecode is nothing but a set of highly optimized computer instructions that could be executed by Java Virtual Machine
  • 2. • The programs could be executed easily across a wide range of platforms by means of translation in to bytecode. This is because all that is required is a JVM being tailored for that particular platform. • There could be a difference in configuration for different platforms in JVM and the same set of bytecodes could be understood easily. All this makes Java program a platform independent one. Differentiate between JDK and JRE This is a typical Java interview question that has confused most of the Java developers and it is important for Java developers to understand the difference between JDK and JRE which would help take their career to the next level. JDK stands for Java Development Kit which is a comprehensive package of software which can be used for creating Java based software. On the other hand, JRE stands for Java Runtime Environment. It is nothing but an implementation of Java Virtual Machine that is capable of executing Java programs. Each of the JDK would be comprised of one or more JRE’s in addition to different kind of development tools such as Java source compilers, debuggers, development libraries and bundling as well as deployment of tools etc. What is the difference between Constructors, Copy Constructor and Constructor Overloading in Java? For beginners, Constructors is considered to be basics of OOPS. Constructor – Creating an instance of a class remains the most important objective of having Constructors. Whenever an object of a class has been created, the constructors would be invoked. Some of the key characteristics of Java Constructors are as follows. • Constructors could be public, private and protected etc. • Default no-argument constructor could not be used whenever a constructor with arguments has been defined in a class. • Whenever the classes are being instantiated, they would be called only once. • Constructors would have the same name as that of the class. • Value is not returned and therefore they need not have to specify the keyword void.
  • 3. • Java helps in creating a so called default no-argument constructor whenever a constructor for the class is not created. Constructor Overloading – Constructor overloading can be defined as the passing of various number as well as type of variables as arguments out of which most of them are regarded as private variables of the class. Copy Constructor – A type of constructor that is capable of constructing the object of class from another object of the same class is defined as Copy Constructor. The reference of its own class is considered as a parameter by the copy constructor. Define Java Exception Handling and differentiate between Unchecked Exception, Checked Exception and Errors? Exception is a method to point out the occurring of an abnormal condition in Java. Exceptions are considered as objects in Java and whenever an exception is thrown, the object is also thrown. It has to be understood that it is not possible to simply throw any objection as an exception. The throwable is considered as a base class for the entire family of classes that has been declared in java.lang which your program can instantiate and throw. Unchecked Exception – It is inherited from RunTimeException and the RunTimeException is treated differently by JVM as the application code is not required to deal with them explicitly. Checked Exception – It is basically inherited from the Exception-class. The checked exceptions have to be handled by a client code either through a try-catch clause or should be thrown for the Super class to catch the same. Errors – Errors are popularly thrown for problems that deserve more seriousness. The problems usually include OutOfMemoryError or OOM that is not that easy to handle as well as manage. It is desirable to set aside some time in improving the Java skills as exception handling requires some special attention while designing of huge applications. Mention the key differences between Byte Streams and Character Streams Most of the Java programmers are very much familiar with the file operations. The list of file operations ranges from generating user reports,
  • 4. sending of attachments through mails as well as filling out the data files from Java programs. Having an in-depth knowledge regarding file operations is very essential for Java developers who are dealing with Java interview questions. Byte Stream It is used for the reading as well as writing of binary data. The byte streams are used by programs for performing the byte input as well as byte output. Performing InputStreams operations as well as OutputStream operations means the presence of a loop that is capable of reading the input stream as well as writing the output stream one byte at a time. The buffered I/O streams could be also used for an overhead reduction if any. Character Streams Character streams work along with characters other than bytes. Unicode conventions are considered while storing the characters in Java. During such type of storage, characters usually become platform independent, program independent as well as language independent. Differentiate between the functions of Over-Riding and Over- Loading in Java? It is regarded as an important aspect in Object-Oriented Programming and the concepts as well as functionalities of Over-Riding and Over- Loading in Java has to be understood by every Java programmer. Over-Riding It is a function type that occurs in a class that is inherited by another class. The functions that are inherited from the base class are replaced by means of an Over-Ride function. However it is implemented in such a way that it is called even though an instance of its class is pretending to be different type through polymorphism. Over-Loading Whenever multiple methods with the same name along with different parameters are defined through an action, then it can be defined as overloading. However it is not at all related to overriding or polymorphism. Two mechanisms are usually used for overloading the functions in Java. The two mechanisms include ‘varying the number of arguments’ as well as ‘varying the data type’.
  • 5. List the most common data types supported by Java This is one of the most popular and fundamental questions that are asked as part of Java interview questions. The list of eight primitive data types supported by Java is as follows. • Byte • Short • Int • Long • Float • Double • Char • Boolean What is the difference between Autoboxing and Unboxing? Autoboxing is defined as the automatic transformation of primitive types in to its object equivalents or wrapper types for making the compilation easier. The automatic transformation is performed by a Java Compiler. Unboxing can be defined as the automatic conversion of wrapper types in to its primitive equivalent. What are the key differences between interface and an abstract class? Abstract class is a partially implemented class by a programmer and it could be comprised of more than one abstract techniques. However interface is considered similar to an abstract class and it occupies the same namespaces as that of classes as well as abstract classes. Therefore it is not possible to define an interface with the same name as that of classes. The interface is more of a fully abstract class. Similarly abstract classes could be comprised of constants, members, defined methods and method stubs at the same time interfaces consists of only constants as well as method stubs. Methods of an interface should be defined as public where as the methods of an abstract class can be defined with any visibility. Whether garbage collection is an automatic process?
  • 6. Yes, garbage collection is an automatic process and it could be requested by means of calling System.gc (). The immediate starting of Garbage Collection however cannot be guaranteed by JVM. Garbage collection is also considered to be the most relevant feature of Java and is also known as automatic memory management. This is because the unused variables or objects from the memory can be automatically removed by the JVM. The object in the memory cannot be freed directly by the user program whereas it is up to the garbage collector for automatically freeing the objects that are no longer referenced by a program. Define Memory Leak Whenever an unreferenced object that is not of any use is still not garbage collected and thereby still hangs around within the memory is often referred to as a memory leak. Define Instance Variables in Java The variables that are defined at a class level are known as Instance Variables. There is no need to initialize instance variables before making use of them as it could be automatically initialized towards their default values. Differentiate between Path and Class-path Both Path and Class-path are considered as operating system level environment variables. Classpath is used for specifying the location .class files whereas Path is used for defining where the executable files (.exe files) could be used within the system. Define Java Reflection Java Reflection is commonly used by programs that require the ability to examine as well as modify the runtime behaviour of applications that are powered by the Java Virtual Machine. When the interface or abstract class has to be used? To declare the methods as well as members a class must have, Interface is used. The methods listed by the interface have to be declared and implemented by users implementing the interface. Abstract class is used whenever users require a default implementation. Thus users can implement any number of interfaces as they require, however they would be able to extend only one class. Contract or Standard is defined by
  • 7. Interfaces and those contracts or standard has to be followed during the implementation of the interface. What is the major difference between StringBuffer and StringBuilder? The most important difference between StringBuffer and StringBuilder is that the StringBuffer is synchronized where as the StringBuilder is unsynchronized. If the text could be changed and the accessibility is possible only from a single thread, then it is desirable to make use of StringBuilder as it is unsynchronized. At the same time if the text can change and it has to be accessed from multiple threads, then it is desirable to make use of StringBuffer as it is synchronous. Does Java support Pointers? Pointer can be defined as a reference handle towards a memory location. If the pointer is not handled properly, it can result in memory leaks as well as reliability issues. This is the main reason why the usage of pointers is not supported by Java.