Skip to main content

Java J2EE Interview Questions and Answers - Part 3

  1. What is a cloneable interface and how many methods does it contain?- It is not having any method because it is a TAGGED or MARKER interface.
  2. What is the difference between abstract class and interface?- a) All the methods declared inside an interface are abstract whereas abstract class must have at least one abstract method and others may be concrete or abstract. b) In abstract class, key word abstract must be used for the methods whereas interface we need not use that keyword for the methods. c) Abstract class must have subclasses whereas interface can’t have subclasses.
  3. Can you have an inner class inside a method and what variables can you access?- Yes, we can have an inner class inside a method and final variables can be accessed.
  1. What is the difference between String and String Buffer?- a) String objects are constants and immutable whereas StringBuffer objects are not. b) String class supports constant strings whereas StringBuffer class supports growable and modifiable strings.
  2. What is the difference between Array and vector?- Array is a set of related data type and static whereas vector is a growable array of objects and dynamic.
  3. What is the difference between exception and error?- The exception class defines mild error conditions that your program encounters. Exceptions can occur when trying to open the file, which does not exist, the network connection is disrupted, operands being manipulated are out of prescribed ranges, the class file you are interested in loading is missing. The error class defines serious error conditions that you should not attempt to recover from. In most cases it is advisable to let the program terminate when such an error is encountered.
  1. What is the difference between process and thread?- Process is a program in execution whereas thread is a separate path of execution in a program.
  2. What is multithreading and what are the methods for inter-thread communication and what is the class in which these methods are defined?- Multithreading is the mechanism in which more than one thread run independent of each other within the process. wait (), notify () and notifyAll() methods can be used for inter-thread communication and these methods are in Object class. wait() : When a thread executes a call to wait() method, it surrenders the object lock and enters into a waiting state. notify() or notifyAll() : To remove a thread from the waiting state, some other thread must make a call to notify() or notifyAll() method on the same object.
  3. What is the class and interface in java to create thread and which is the most advantageous method?- Thread class and Runnable interface can be used to create threads and using Runnable interface is the most advantageous method to create threads because we need not extend thread class here.
  1. What are the states associated in the thread?- Thread contains ready, running, waiting and dead states.
  2. What is synchronization?- Synchronization is the mechanism that ensures that only one thread is accessed the resources at a time.
  3. When you will synchronize a piece of your code?- When you expect your code will be accessed by different threads and these threads may change a particular data causing data corruption.
  1. What is deadlock?- When two threads are waiting each other and can’t precede the program is said to be deadlock.
  2. What is daemon thread and which method is used to create the daemon thread?- Daemon thread is a low priority thread which runs intermittently in the back ground doing the garbage collection operation for the java runtime system. setDaemon method is used to create a daemon thread.
  3. Are there any global variables in Java, which can be accessed by other part of your program?- No, it is not the main method in which you define variables. Global variables is not possible because concept of encapsulation is eliminated here.

Comments

Popular Posts

DOT NET Interview Questions with Answers

When not to use Design Patterns?Do not use design patterns in any of the following situations.• When the software being designed would not change with time.• When the requirements of the source code of the application are unique.If any of the above applies in the current software design, there is no need to apply design patterns in the current design and increase unnecessary complexity in the design.When to use Design Patterns?Design Patterns are particularly useful in one of the following scenarios.• When the software application would change in due course of time.• When the application contains source code that involves object creation and event notification.Benefits of Design Patterns:The following are some of the major advantages of using Design Patterns in software development.• Flexibility• Adaptability to change• ReusabilityWhat are Design Patterns?A Design Pattern essentially consists of a problem in a software design and a solution to the same. In Design Patterns each pattern…

PDF Converter Ultimate - Awesome Converter

PDF Converter Ultimate 
Convert your documents to PDF, and PDF documents to Word, Excel, JPG, and more, right on your Android device. Conversions are accurate and very fast, layout is preserved, and best-on-market OCR engines will take care of your scanned files. Easy to use app, and amazing conversion quality makes this app the ultimate converter for your phone. You can convert files from your phone, or files from your favorite cloud services directly within our app. Files are being converted by our powerful servers, and after conversion is done, result is downloaded to your device and files are being deleted from our servers. This also means the app won't burden your processor or RAM, nor it will drain your battery.

• Conversions are fast and accurate
• Scanned and complex documents are converted as well 
• Immediate conversions for free users
• Several conversion types available depending on the file format needed
• No limit on file size or number of files you can convert
• Convert f…

Free Java Tutorial from Guru99

FREE JAVA TUTORIAL
Guru99 Goal is to provide Fun and Free Education for ALL.

Guru99 recently create tutorials on JAVA that took 190 hours to create with beautifully annotated screenshots, videos and is very comprehensive.

The course covers

JAVA Basics like Java Virtual Machine (JVM) and Download and Install Guide.
It also introduces Concepts of OOPs, Constructors, Inheritance, Memory Management, Exception Handling and Conditional Loops.
We also touch on advanced topics like Multithreading, Timer and Java Reflection API

Here is the Link: http://www.guru99.com/java-tutorial.html


!! LEARN NOW !!


free java tutorial, guru99, learn java online for free, java classes, java videos, java interview questions and answers, java topics.

Visual Studio 2008 - Interview Questions with answers

New Features of Visual Studio 2008 for .NET Professionals1. LINQ Support

LINQ essentially is the composition of many standard query operators that allow you to work with data in a more intuitive way regardless.

The benefits of using LINQ are significant – Compile time checking C# language queries, and the ability to debug step by step through queries.

2. Expression Blend Support


Expression blend is XAML generator tool for silverlight applications. You can install Expression blend as an embedded plug-in to Visual Studio 2008. By this you can get extensive web designer and JavaScript tool.

3. Windows Presentation Foundation

WPF provides you an extensive graphic functionality you never seen these before. Visual Studio 2008 contains plenty of WPF Windows Presentation Foundation Library templates. By this a visual developer who is new to .NET, C# and VB.NET can easily develop the 2D and 3D graphic applications.

Visual Studio 2008 provides free game development library kits for games develo…

Mobile Number Portability in India by Sept 20

Department of Telecom has issued (.pdf) a notification stating that long awaited number portability will finally be available by September 20. The main object of number portability is to be able to retain the same number even after switching between different mobile service providers.  

Mobile Number Portability gives a mobile subscriber the leverage of retaining his/her mobile phone number even after switching between networks. As per Department of Telecom - Mobile Number Portability is to be implemented in Delhi, Mumbai, Maharashtra and Gujarat Service areas of Zone I and Zone 2 includes Kolkata, Tamil Nadu, Chennai, Andhra and Karnataka of within six months of award of license by September 20, 2009, and in the rest of the country by March 20, 2010.

Syniverse Technologies have been licensed for MNP operations in Zone I while MNP Interconnection got licensed for MNP operations in Zone 2.  

TRAI will decide all kinds of mobile number portability tariffs like the transaction fees from…

DesignEvo - A free and easy online logo designer

DesignEvo is easy-to-use online logo design tool with millions of icons, 100+ stylish fonts, 3,000+ practical logo templates and handy editing tools. It can help people easily create appealing and effective logos for their brands, websites, blogs, social media channels, etc.

 It is really awesome and intuitive interface. Easy to design and customize. A person can easily design by selecting a pre-defined logo design and modify it on the fly.

Hardly you need 1 minute to design your new logo with minor modifications.


Its really awesome site. I suggest you to try it out.



You can discover more about DesignEvo here:
https://www.designevo.com

Learn more about Designevo @ YouTube

designevo, free logo design, logo maker, create a logo, easy logo maker, design logo free, free logo, logo designs, logo images

Contact Form

Name

Email *

Message *