0% found this document useful (0 votes)
102 views

Java Questions For Viva3

Uploaded by

Krishna Reddy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views

Java Questions For Viva3

Uploaded by

Krishna Reddy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

11/30/21, 3:08 PM Java questions for viva

Home
Explore

Search
Submit Search

Upload
Login
Signup

Home
Explore

Login
Signup

Search

Successfully reported this slideshow.


We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

https://www.slideshare.net/VipulNaik2/java-questions-for-viva 1/20
11/30/21, 3:08 PM Java questions for viva

https://www.slideshare.net/VipulNaik2/java-questions-for-viva 2/20
11/30/21, 3:08 PM Java questions for viva

https://www.slideshare.net/VipulNaik2/java-questions-for-viva 3/20
11/30/21, 3:08 PM Java questions for viva

https://www.slideshare.net/VipulNaik2/java-questions-for-viva 4/20
11/30/21, 3:08 PM Java questions for viva

https://www.slideshare.net/VipulNaik2/java-questions-for-viva 5/20
11/30/21, 3:08 PM Java questions for viva

Upcoming SlideShare

Loading in …5
×


2 of 6

1
of 6

Next SlideShares

https://www.slideshare.net/VipulNaik2/java-questions-for-viva 6/20
11/30/21, 3:08 PM Java questions for viva

Upcoming SlideShare
Basic java important interview questions and answers to secure a job
Next
Download Now
Download to read offline and view in fullscreen.
Education
Dec. 16, 2014
35,631 views

49 Likes

Share

Download Now
Download

Download to read offline

Java questions for viva


Download Now
Download

Download to read offline

Education
Dec. 16, 2014
35,631 views

Java questions for viva

Read more

Vipul Naik
Follow
Head
at
S.S.samiti's Higher Sec. School, Kavalem ponda

Recommended

Basic java important interview questions and answers to secure a job


Garuda Trainings

Java programming-examples
Mumbai Academisc
https://www.slideshare.net/VipulNaik2/java-questions-for-viva 7/20
11/30/21, 3:08 PM Java questions for viva

Java codes
Hussain Sherwani

Most Asked Java Interview Question and Answer


TOPS Technologies

Top 10 Java Interview Questions and Answers 2014


iimjobs and hirist

Servlet viva questions


Vipul Naik

Dbms viva questions


Balveer Rathore

Java PRACTICAL file


RACHIT_GUPTA

Java Code for Sample Projects Inheritance


jwjablonski

Ad java prac sol set


Iram Ramrajkar

Related Books

Free with a 30 day trial from Scribd

See all
Carousel previous

https://www.slideshare.net/VipulNaik2/java-questions-for-viva 8/20
11/30/21, 3:08 PM Java questions for viva

Fighting Forward: Your Nitty-Gritty Guide to Beating the Lies That Hold You Back
Hannah Brencher
(0/5)
Free

Let's Talk About Hard Things


Anna Sale
(4/5)
Free

Dedicated: The Case for Commitment in an Age of Infinite Browsing


Pete Davis
(5/5)
Free

Keep Sharp: Build a Better Brain at Any Age


Sanjay Gupta
(4/5)
Free

No One Succeeds Alone: Learn Everything You Can from Everyone You Can
Robert Reffkin
(4/5)
Free

https://www.slideshare.net/VipulNaik2/java-questions-for-viva 9/20
11/30/21, 3:08 PM Java questions for viva

Average Expectations: Lessons in Lowering the Bar


Shep Rose
(3/5)
Free

High Conflict: Why We Get Trapped and How We Get Out


Amanda Ripley
(5/5)
Free

Dry: A Memoir
Augusten Burroughs
(4.5/5)
Free

The 7 Habits of Highly Effective People Personal Workbook


Stephen R. Covey
(4/5)
Free

Less Fret, More Faith: An 11-Week Action Plan to Overcome Anxiety


Max Lucado
(4.5/5)
Free

https://www.slideshare.net/VipulNaik2/java-questions-for-viva 10/20
11/30/21, 3:08 PM Java questions for viva

Girl, Stop Apologizing: A Shame-Free Plan for Embracing and Achieving Your Goals
Rachel Hollis
(3.5/5)
Free

Maybe You Should Talk to Someone: A Therapist, HER Therapist, and Our Lives Revealed
Lori Gottlieb
(4.5/5)
Free

Uninvited: Living Loved When You Feel Less Than, Left Out, and Lonely
Lysa TerKeurst
(4.5/5)
Free

Girl, Wash Your Face: Stop Believing the Lies About Who You Are so You Can Become Who You Were Meant to Be
Rachel Hollis
(3.5/5)
Free

Boundaries Updated and Expanded Edition: When to Say Yes, How to Say No To Take Control of Your Life
Henry Cloud
(4/5)
Free

https://www.slideshare.net/VipulNaik2/java-questions-for-viva 11/20
11/30/21, 3:08 PM Java questions for viva

Never Split the Difference: Negotiating As If Your Life Depended On It


Chris Voss
(4.5/5)
Free
Carousel next

1 2 3 4

Related Audiobooks

Free with a 30 day trial from Scribd

See all
Carousel previous

The Design Thinking Mindset: How to Access the Power of Innovation


Darin Eich
(5/5)
Free

My Friend Fear: How to Move Through Social Anxiety and Embrace the Life You Want
Rose Berry
(5/5)
Free

Extraordinary Awakenings: When Trauma Leads to Transformation


Steve Taylor
(2.5/5)
Free

A Body to Love: Cultivate Community, Body Positivity, and Self-Love in the Age of Social Media
Angelina Caruso
(5/5)
Free

10 Rules for Resilience: Mental Toughness for Families


Joe De Sena
(0/5)
Free

Out with the Old, In with the You


Tess Brigham
(5/5)
Free

Empath Up!: How to Embrace the Gift of Empathy


Cheryl Hutchinson
(4.5/5)
Free

The Authentic Leader: Five Essential Traits of Effective, Inspiring Leaders


Merinda Smith
(5/5)
Free

Getting More Done: Wielding Intention and Planning to Achieve Your Most Ambitious Goals
Michelle Loucadoux
(4.5/5)
Free

The Power of Your Attitude: 7 Choices for a Happy and Successful Life
Stan Toler
(4.5/5)
Free

Winning: The Unforgiving Race to Greatness


Tim S. Grover
(5/5)
Free

Power, for All: How It Really Works and Why It's Everyone's Business
Julie Battilana
(4.5/5)
Free

Bloom Forward: Healing from Trauma


Emmy Marie
(4/5)
Free

The Full Spirit Workout: A 10-Step System to Shed Your Self-Doubt, Strengthen Your Spiritual Core, and Create a Fun & Fulfilling Life
Kate Eckman
(4/5)
Free

Checking In: How Getting Real about Depression Saved My Life---and Can Save Yours
Michelle Williams
(4.5/5)
Free

https://www.slideshare.net/VipulNaik2/java-questions-for-viva 12/20
11/30/21, 3:08 PM Java questions for viva

Live Your Life: My Story of Loving and Losing Nick Cordero


Amanda Kloots
(4.5/5)
Free
Carousel next

1 2 3 4

49 Likes
Statistics
Notes

HarshSen7
2 months ago

telugutechworld1
2 months ago

ShaileshYadav753013
2 months ago

HarshitTinkar
3 months ago

Matchless Bilal
9 months ago

Bhargavreddy147
9 months ago

Aswathy M B
9 months ago

Josh Josh
10 months ago

AkshayPokharkar5
11 months ago

AviralAgarwal34
12 months ago

Vinod Kumar
1 year ago

NaomiNan
1 year ago

Deepthi Narayana
1 year ago

Reshma Bharath
2 years ago

Masudadmad
2 years ago

https://www.slideshare.net/VipulNaik2/java-questions-for-viva 13/20
11/30/21, 3:08 PM Java questions for viva

pidugusrinivasu
2 years ago

Srikanth Thumma
2 years ago

BijayaLaxmi7
2 years ago

Himanshu Sharma
2 years ago

Pragya Rawat
2 years ago

Show More
Views
Total views
35,631
On SlideShare
0
From Embeds
0
Number of Embeds
64
Actions
Shares
0
Downloads
609
Comments
0
Likes
49
No notes for slide

Java questions for viva


1. 1.
Java Questions
1. Q: What do you know about Java?
A: Java is a high-level programming language originally developed by Sun Microsystems and released
in 1995. Java runs on a variety of
platforms, such as Windows, Mac OS, and the various versions of UNIX.
2. Q: What are the supported platforms by Java
Programming Language?
A: Java runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX/Linux like HP-Unix, Sun
Solaris,
Redhat Linux, Ubuntu, CentOS, etc.
3. Q: List any five features of Java?
A: Some features include Object Oriented, Platform Independent, Robust,
Interpreted, Multi-threaded
4. Q: What is Java Virtual Machine and how it is considered in context of Java’s platform independent feature?
A: When Java is
compiled, it is not compiled into platform specific machine, rather into platform independent byte code. This byte code is
distributed over the web and
interpreted by virtual Machine (JVM) on whichever platform it is being run.
5. Q: List two Java IDE’s?
A: Netbeans, Eclipse, etc.
6. Q: What do you mean by
Object?
A: Object is a runtime entity and it’s state is stored in fields and behavior is shown via methods. Methods operate on an object's internal
state and
serve as the primary mechanism for object-to-object communication.
7. Q: Define class?
A: A class is a blue print from which individual objects are created. A
class can contain fields and methods to describe the behavior of an
object.
8. Q: What kind of variables a class can consist of?
A: A class consist of Local
variable, instance variables and class variables.
9. Q: What is a Local Variable
A: Variables defined inside methods, constructors or blocks are called local
variables. The variable will be declared and initialized within
the method and it will be destroyed when the method has completed.
10. Q: What is a Instance
Variable
A: Instance variables are variables within a class but outside any method. These variables are instantiated when the class is loaded.
11. Q: What is a
Class Variable
A: These are variables declared with in a class, outside any method, with the static keyword.
12. Q: What do you mean by Constructor?
A:
Constructor gets invoked when a new object is created. Every class has a constructor. If we do not explicitly write a constructor for a
class the java compiler
builds a default constructor for that class.
13. Q: List the three steps for creating an Object for a class?
A: An Object is first declared, then instantiated and then
it is initialized.
14. Q: What is the default value of byte datatype in Java?
A: Default value of byte datatype is 0.
15. Q: What is the default value of float and
double datatype in Java?
A: Default value of float and double datatype in different as compared to C/C++. For float its 0.0f and for double it’s 0.0d
16. Q:
When a byte datatype is used?
A: This data type is used to save space in large arrays, mainly in place of integers, since a byte is four times smaller than an int.
17. Q: What is a static variable?
A: Class variables also known as static variables are declared with the static keyword in a class, but outside a method,
constructor or a
block.
18. Q: What do you mean by Access Modifier?
A: Java provides access modifiers to set access levels for classes, variables, methods
and constructors. A member has package or
default accessibility when no accessibility modifier is specified.
19. Q: According to Java Operator precedence,
which operator is considered to be with highest precedence?
A: Postfix operators i.e () [] . is at the highest precedence.
20. Q: When parseInt() method can be
used?
A: This method is used to get the primitive data type of a certain String.
21. Q: Why is String class considered immutable?
A: The String class is
immutable, so that once it is created a String object cannot be changed. Since String is immutable it can safely be
shared between many threads ,which is
considered very important for multithreaded programming.
22. Q: Why is StringBuffer called mutable?
2. 2.
A: The String class is considered as immutable, so that once it is created a String object cannot be changed. If there is a necessity to
make alot of
modifications to Strings of characters then StringBuffer should be used.
23. Q: What is the difference between StringBuffer and StringBuilder class?
A: Use
StringBuilder whenever possible because it is faster than StringBuffer. But, if thread safety is necessary then use StringBuffer
objects.
24. Q: Which package
is used for pattern matching with regular expressions?
A: java.util.regex package is used for this purpose.
25. Q: java.util.regex consists of which classes?
A:
java.util.regex consists of three classes: Pattern class, Matcher class and PatternSyntaxException class.
26. Q: What is finalize() method?
A: It is possible to
define a method that will be called just before an object's final destruction by the garbage collector. This method is
called finalize( ), and it can be used to
ensure that an object terminates cleanly.
27. Q: What is an Exception?
A: An exception is a problem that arises during the execution of a program. Exceptions
are caught by handlers positioned along the
thread's method invocation stack.
28. Q: What do you mean by Checked Exceptions?
A: It is an exception that is
typically a user error or a problem that cannot be foreseen by the programmer. For example, if a file is to be
opened, but the file cannot be found, an exception
occurs. These exceptions cannot simply be ignored at the time of compilation.
29. Q: Explain Runtime Exceptions?
A: It is an exception that occurs that
probably could have been avoided by the programmer. As opposed to checked exceptions, runtime
exceptions are ignored at the time of compliation.
30. Q:
Which are the two subclasses under Exception class?
A: The Exception class has two main subclasses : IOException class and RuntimeException Class.
31. Q:

https://www.slideshare.net/VipulNaik2/java-questions-for-viva 14/20
11/30/21, 3:08 PM Java questions for viva
When throws keyword is used?
A: If a method does not handle a checked exception, the method must declare it using the throwskeyword. The throws
keyword appears
at the end of a method's signature.
32. Q: When throw keyword is used?
A: An exception can be thrown, either a newly instantiated one or an
exception that you just caught, by using throw keyword.
33. Q: How finally used under Exception Handling?
A: The finally keyword is used to create a block
of code that follows a try block. A finally block of code always executes, whether or not an
exception has occurred.
34. Q: Define Inheritance?
A: It is the
process where one object acquires the properties of another. With the use of inheritance the information is made manageable
in a hierarchical order.
35. Q:
When super keyword is used?
A: If the method overrides one of its superclass's methods, overridden method can be invoked through the use of the keyword
super. It
can be also used to refer to a hidden field
36. Q: What is Polymorphism?
A: Polymorphism is the ability of an object to take on many forms. The most
common use of polymorphism in OOP occurs when a parent
class reference is used to refer to a child class object.
37. Q: What is Abstraction?
A: It refers to
the ability to make a class abstract in OOP. It helps to reduce the complexity and also improves the maintainability of the
system.
38. Q: What is Abstract class
A: These classes cannot be instantiated and are either partially implemented or not at all implemented. This class contains one or more
abstract methods which
are simply method declarations without a body.
39. Q: When Abstract methods are used?
A: If you want a class to contain a particular method but you want
the actual implementation of that method to be determined by child
classes, you can declare the method in the parent class as abstract.
40. Q: What is
Encapsulation?
A: It is the technique of making the fields in a class private and providing access to the fields via public methods. If a field is declared
private,
it cannot be accessed by anyone outside the class, thereby hiding the fields within the class. Therefore encapsulation is also
referred to as data hiding.
41. Q:
What is the primary benefit of Encapsulation?
A: The main benefit of encapsulation is the ability to modify our implemented code without breaking the code
of others who use our code.
With this Encapsulation gives maintainability, flexibility and extensibility to our code.
3. 3.
42. Q: What is an Interface?
A: An interface is a collection of abstract methods. A class implements an interface, thereby inheriting the abstract methods of
the
interface.
43. Q: Give some features of Interface?
A: It includes:
Interface cannot be instantiated
An interface does not contain any constructors.
All of the
methods in an interface are abstract.
44. Q: Define Packages in Java?
A: A Package can be defined as a grouping of related types(classes, interfaces,
enumerations and annotations ) providing access
protection and name space management.
45. Q: Why Packages are used?
A: Packages are used in Java in-
order to prevent naming conflicts, to control access, to make searching/locating and usage of classes,
interfaces, enumerations and annotations, etc., easier.
46.
Q: What do you mean by Multithreaded program?
A: A multithreaded program contains two or more parts that can run concurrently. Each part of such a
program is called a thread, and
each thread defines a separate path of execution.
47. Q: What are the two ways in which Thread can be created?
A: Thread can
be created by: implementing Runnable interface, extending the Thread class.
48. Q: What is an applet?
A: An applet is a Java program that runs in a Web
browser. An applet can be a fully functional Java application because it has the entire
Java API at its disposal.
49. Q: An applet extend which class?
A: An
applet extends java.applet.Applet class.
50. Q: Explain garbage collection in Java?
A: It uses garbage collection to free the memory. By cleaning those objects
that is no longer reference by any of the program.
51. Q: Define immutable object?
A: An immutable object can’t be changed once it is created.
52. Q: Explain
the usage of this() with constructors?
A: It is used with variables or methods and used to call constructer of same class.
53. Q: Explain Set Interface?
A: It is a
collection of element which cannot contain duplicate elements. The Set interface contains only methods inherited from Collection
and adds the restriction that
duplicate elements are prohibited.
54. Q: Explain TreeSet?
A: It is a Set implemented when we want elements in a sorted order.
55. Q: What is Comparable
Interface?
A: It is used to sort collections and arrays of objects using the collections.sort() and java.utils. The objects of the class implementing the
Comparable interface can be ordered.
56. Q: Difference between throw and throws?
A: It includes:
Throw is used to trigger an exception where as throws is
used in declaration of exception.
Without throws, Checked exception cannot be handled where as checked exception can be propagated with throws.
57. Q:
Explain the following line used under Java Program:
public static void main (String args[ ])
A: The following shows the explanation individually:
public: it is
the access specifier.
static: it allows main() to be called without instantiating a particular instance of a class.
4. 4.
void: it affirns the compiler that no value is returned by main().
main(): this method is called at the beginning of a Java program.
String args[ ]: args
parameter is an instance array of class String
58. Q: Define JRE i.e. Java Runtime Environment?
A: Java Runtime Environment is an implementation of the
Java Virtual Machine which executes Java programs. It provides the minimum
requirements for executing a Java application;
59. Q: What is JAR file?
A: JAR
files is Java Archive fles and it aggregates many files into one. It holds Java classes in a library. JAR files are built on ZIP file
format and have .jar file
extension.
60. Q: What is a WAR file?
A: This is Web Archive File and used to store XML, java classes, and JavaServer pages. which is used to distribute a
collection of
JavaServer Pages, Java Servlets, Java classes, XML files, static Web pages etc.
61. Q: Define JIT compiler?
A: It improves the runtime
performance of computer programs based on bytecode.
62. Q: What is the difference between object oriented programming language and object based
programming language?
A: Object based programming languages follow all the features of OOPs except Inheritance. JavaScript is an example of object based
programming languages
63. Q: What is the purpose of default constructor?
A: The java compiler creates a default constructor only if there is no constructor in
the class.
64. Q: Can a constructor be made final?
A: No, this is not possible.
65. Q: What is static block?
A: It is used to initialize the static data member, It is
excuted before main method at the time of classloading.
66. Q: Define composition?
A: Holding the reference of the other class within some other class is
known as composition.
67. Q: What is function overloading?
A: If a class has multiple functions by same name but different parameters, it is known as
Method Overloading.
68. Q: What is function overriding?
A: If a subclass provides a specific implementation of a method that is already provided by its parent
class, it is known as Method
Overriding.
69. Q: Difference between Overloading and Overriding?
A: Method overloading increases the readability of the
program. Method overriding provides the specific implementation of the method
that is already provided by its super class parameter must be different in case
of overloading, parameter must be same in case of
overriding.
70. Q: What is final class?
A: Final classes are created so the methods implemented by that class
cannot be overridden. It can’t be inherited.
71. Q: What is NullPointerException?
A: A NullPointerException is thrown when calling the instance method of a
null object, accessing or modifying the field of a null object etc.
72. Q: What are the ways in which a thread can enter the waiting state?
A: A thread can enter
the waiting state by invoking its sleep() method, by blocking on IO, by unsuccessfully attempting to acquire an
object's lock, or by invoking an object's wait()
method. It can also enter the waiting state by invoking its (deprecated) suspend() method.
73. Q: How does multi-threading take place on a computer with a
single CPU?
A: The operating system's task scheduler allocates execution time to multiple tasks. By quickly switching between executing tasks, it
creates the
impression that tasks execute sequentially.
74. Q: What invokes a thread's run() method?
A: After a thread is started, via its start() method of the Thread class,
the JVM invokes the thread's run() method when the thread is
initially executed.
75. Q: Does it matter in what order catch statements for
FileNotFoundException and IOException are written?
A: Yes, it does. The FileNoFoundException is inherited from the IOException. Exception's subclasses
have to be caught first.
76. Q: What is the difference between yielding and sleeping?
A: When a task invokes its yield() method, it returns to the ready state.
When a task invokes its sleep() method, it returns to the waiting
state.
77. Q: Why Vector class is used?
5. 5.
A: The Vector class provides the capability to implement a growable array of objects. Vector proves to be very useful if you don't know
the size of the array
in advance, or you just need one that can change sizes over the lifetime of a program.
78. Q: How many bits are used to represent Unicode, ASCII, UTF-16,
and UTF-8 characters?
A: Unicode requires 16 bits and ASCII require 7 bits. Although the ASCII character set uses only 7 bits, it is usually represented as 8
bits.
UTF-8 represents characters using 8, 16, and 18 bit patterns. UTF-16 uses 16-bit and larger bit patterns.
79. Q: What are Wrapper classes?
A: These are
classes that allow primitive types to be accessed as objects. Example: Integer, Character, Double, Boolean etc.
80. Q: What is the difference between a
Window and a Frame?
A: The Frame class extends Window to define a main application window that can have a menu bar.
81. Q: Which package has light
weight components?
A: javax.Swing package. All components in Swing, except JApplet, JDialog, JFrame and JWindow are lightweight components.
82. Q:
What is the difference between the paint() and repaint() methods?
A: The paint() method supports painting via a Graphics object. The repaint() method is used
to cause paint() to be invoked by the AWT
painting thread.
83. Q: What is the purpose of File class?
A: It is used to create objects that provide access to the
files and directories of a local file system.
84. Q: What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class
hierarchy?
A: The Reader/Writer class hierarchy is character-oriented, and the InputStream/OutputStream class hierarchy is byte-oriented.
85. Q: Which class
should you use to obtain design information about an object?
A: The Class class is used to obtain information about an object's design and java.lang.Class
class instance represent classes, interfaces
in a running Java application.
86. Q: What is the difference between static and non-static variables?
A: A static
variable is associated with the class as a whole rather than with specific instances of a class. Non-static variables take on
unique values with each object
instance.
87. Q: What is Serialization and deserialization?
A: Serialization is the process of writing the state of an object to a byte stream. Deserialization is the
process of restoring these objects.
88. Q: Can you write a Java class that could be used both as an applet as well as an application?
A: Yes, just add a main()
method to the applet.
89. Q: What is the difference between Swing and AWT components?
A: AWT components are heavy-weight, whereas Swing
components are lightweight. Heavy weight components depend on the local
windowing toolkit. For example, java.awt.Button is a heavy weight component,
when it is running on the Java platform for Unix platform, it
maps to a real Motif button.
90. Q: What's the difference between constructors and other
methods?
A: Constructors must have the same name as the class and can not return a value. They are only called once while regular methods
could be called
many times.
91. Q: Is there any limitation of using Inheritance?
A: Yes, since inheritance inherits everything from the super class and interface, it may make
the subclass too clustering and sometimes
error-prone when dynamic overriding or dynamic overloading in some situation.
92. Q: What's the difference
between the methods sleep() and wait()?
A: The code sleep(2000); puts thread aside for exactly two seconds. The code wait(2000), causes a wait of up to two
second. A thread
could stop waiting earlier if it receives the notify() or notifyAll() call. The method wait() is defined in the class Object and the method
sleep()
is defined in the class Thread.
93. Q: When ArithmeticException is thrown?
A: The ArithmeticException is thrown when integer is divided by zero or taking
the remainder of a number by zero. It is never thrown in
floating-point operations.
94. Q: What is the Collections API?
A: The Collections API is a set of
https://www.slideshare.net/VipulNaik2/java-questions-for-viva 15/20
11/30/21, 3:08 PM Java questions for viva
classes and interfaces that support operations on collections of objects.
95. Q: Does garbage collection guarantee that a program will not run out of memory?
A: Garbage collection does not guarantee that a program will not run out of memory. It is possible for programs to use up memory
resources faster than they
are garbage collected. It is also possible for programs to create objects that are not subject to garbage
collection.
96. Q: What is the difference between a break
statement and a continue statement?
A: A break statement results in the termination of the statement to which it applies (switch, for, do, or while). A continue
statement is used
to end the current loop iteration and return control to the loop statement.
97. Q: If a variable is declared as private, where may the variable be
accessed?
A: A private variable may only be accessed within the class in which it is declared.
6. 6.
98. What is JVM ? Why is Java called the “Platform Independent Programming Language” ? A Java virtual
machine (JVM) is a process virtual machine
that can execute Java bytecode. Each Java source file is
compiled into a bytecode file, which is executed by the JVM. Java was designed to allow application
programs
to be built that could be run on any platform, without having to be rewritten or recompiled by the programmer
for each separate platform. A Java
virtual machine makes this possible, because it is aware of the specific
instruction lengths and other particularities of the underlying hardware platform.
99.
What is the Difference between JDK and JRE ? The Java Runtime Environment (JRE) is basically the Java
Virtual Machine (JVM) where your Java programs
are being executed. It also includes browser plugins for
applet execution. The Java Development Kit (JDK) is the full featured Software Development Kit for
Java,
including the JRE, the compilers and tools (like JavaDoc, and Java Debugger), in order for a user to develop,
compile and execute Java applications.
100. Explain the available thread states in a high-level. During its execution, a thread can reside in one
of the following states:
Runnable: A thread becomes
ready to run, but does not necessarily start running immediately.
Running: The processor is actively executing the thread code.
Waiting: A thread is in a
blocked state waiting for some external processing to finish.
Sleeping: The thread is forced to sleep.
Blocked on I/O: Waiting for an I/O operation to complete.
Blocked on Synchronization: Waiting to acquire a lock.
Dead: The thread has finished its execution.

Recommended

Basic java important interview questions and answers to secure a job


Garuda Trainings

Java programming-examples
Mumbai Academisc

Java codes
Hussain Sherwani

Most Asked Java Interview Question and Answer


TOPS Technologies

Top 10 Java Interview Questions and Answers 2014


iimjobs and hirist

Servlet viva questions


Vipul Naik

https://www.slideshare.net/VipulNaik2/java-questions-for-viva 16/20
11/30/21, 3:08 PM Java questions for viva

Dbms viva questions


Balveer Rathore

Java PRACTICAL file


RACHIT_GUPTA

Java Code for Sample Projects Inheritance


jwjablonski

Ad java prac sol set


Iram Ramrajkar

HarshSen7

Sep. 25, 2021

telugutechworld1

Sep. 22, 2021

ShaileshYadav753013

Sep. 21, 2021

HarshitTinkar

Aug. 5, 2021

MatchlessBilal

Mar. 4, 2021

Bhargavreddy147

https://www.slideshare.net/VipulNaik2/java-questions-for-viva 17/20
11/30/21, 3:08 PM Java questions for viva
Feb. 28, 2021

AswathyMB3

Feb. 16, 2021

JoshJosh37

Jan. 11, 2021

AkshayPokharkar5

Dec. 9, 2020

AviralAgarwal34

Dec. 2, 2020

VinodRajput7

Sep. 18, 2020

NaomiNan

Jun. 29, 2020

DeepthiNarayana

Jan. 7, 2020

ReshmaPoojary5

Nov. 8, 2019

Masudadmad

Oct. 27, 2019

pidugusrinivasu

Sep. 24, 2019

SrikanthThumma3

Aug. 12, 2019

BijayaLaxmi7

https://www.slideshare.net/VipulNaik2/java-questions-for-viva 18/20
11/30/21, 3:08 PM Java questions for viva
Jun. 27, 2019

HimanshuSharma1401

Jun. 6, 2019

PragyaRawat2

Mar. 26, 2019

Java questions for viva

Views

Total views

35,631

On Slideshare

From embeds

Number of embeds

64

Actions

Downloads

609

Shares

Comments

Likes

49

49 Likes Statistics Notes

About
Support
Terms
Privacy
Copyright

English

© 2021 SlideShare from Scribd

English
Español
Português
Français
Deutsch

Share Clipboard

Facebook
Twitter
LinkedIn

Link

https://www.slideshare.net/VipulNaik2/java-questions-for-viva 19/20
11/30/21, 3:08 PM Java questions for viva
Public clipboards featuring this slide

No public clipboards found for this slide

Select another clipboard

Looks like you’ve clipped this slide to already.

Search for a clipboard

Create a clipboard

You just clipped your first slide!


Clipping is a handy way to collect important slides you want to go back to later. Now customize the name of a clipboard to store your clips.

Name*
Best of Slides

Description
Add a brief description so oth

Visibility
Others can see my Clipboard

Cancel
Save
Special Offer to SlideShare Readers
×

Wait! Exclusive 60 day trial


to the world's largest digital library.
The SlideShare family just got bigger. You now have unlimited* access to books, audiobooks, magazines, and more from Scribd.

Activate your free 60 day trial


Cancel anytime.

https://www.slideshare.net/VipulNaik2/java-questions-for-viva 20/20

You might also like