Skip to main content

Java J2EE Interview Questions and Answers - Part 1

  1. What is the difference between procedural and object-oriented programs?- a) In procedural program, programming logic follows certain procedures and the instructions are executed one after another. In OOP program, unit of program is object, which is nothing but combination of data and code. b) In procedural program, data is exposed to the whole program whereas in OOPs program, it is accessible within the object and which in turn assures the security of the code.
  2. What are Encapsulation, Inheritance and Polymorphism?- Encapsulation is the mechanism that binds together code and data it manipulates and keeps both safe from outside interference and misuse. Inheritance is the process by which one object acquires the properties of another object. Polymorphism is the feature that allows one interface to be used for general class actions.
  3. What is the difference between Assignment and Initialization?- Assignment can be done as many times as desired whereas initialization can be done only once.
  4. What is OOPs?- Object oriented programming organizes a program around its data, i. e. , objects and a set of well defined interfaces to that data. An object-oriented program can be characterized as data controlling access to code.
  5. What are Class, Constructor and Primitive data types?- Class is a template for multiple objects with similar features and it is a blue print for objects. It defines a type of object according to the data the object can hold and the operations the object can perform. Constructor is a special kind of method that determines how an object is initialized when created. Primitive data types are 8 types and they are: byte, short, int, long, float, double, boolean, char.
  6. What is an Object and how do you allocate memory to it?- Object is an instance of a class and it is a software unit that combines a structured set of data with a set of operations for inspecting and manipulating that data. When an object is created using new operator, memory is allocated to it.
  7. What is the difference between constructor and method?- Constructor will be automatically invoked when an object is created whereas method has to be called explicitly.
  8. What are methods and how are they defined?- Methods are functions that operate on instances of classes in which they are defined. Objects can communicate with each other using methods and can call methods in other classes. Method definition has four parts. They are name of the method, type of object or primitive type the method returns, a list of parameters and the body of the method. A method’s signature is a combination of the first three parts mentioned above.
  9. What is the use of bin and lib in JDK?- Bin contains all tools such as javac, appletviewer, awt tool, etc., whereas lib contains API and all packages.
  10. What is casting?- Casting is used to convert the value of one type to another.
  11. How many ways can an argument be passed to a subroutine and explain them?- An argument can be passed in two ways. They are passing by value and passing by reference. Passing by value: This method copies the value of an argument into the formal parameter of the subroutine. Passing by reference: In this method, a reference to an argument (not the value of the argument) is passed to the parameter.
  12. What is the difference between an argument and a parameter?- While defining method, variables passed in the method are called parameters. While using those methods, values passed to those variables are called arguments.
  13. What are different types of access modifiers?- public: Anything declared as public can be accessed from anywhere. private: Anything declared as private can’t be seen outside of its class. protected: Anything declared as protected can be accessed by classes in the same package and subclasses in the other packages. default modifier : Can be accessed only to classes in the same package.
  14. What is final, finalize() and finally?- final : final keyword can be used for class, method and variables. A final class cannot be sub classed and it prevents other programmers from sub classing a secure class to invoke insecure methods. A final method can’t be overridden. A final variable can’t change from its initialized value. finalize() : finalize() method is used just before an object is destroyed and can be called just prior to garbage collection. finally : finally, a key word used in exception handling, creates a block of code that will be executed after a try/catch block has completed and before the code following the try/catch block. The finally block will execute whether or not an exception is thrown. For example, if a method opens a file upon exit, then you will not want the code that closes the file to be bypassed by the exception-handling mechanism. This finally keyword is designed to address this contingency.
  15. What is UNICODE?- Unicode is used for internal representation of characters and strings and it uses 16 bits to represent each other.

Comments

Popular Posts

Use Address bar effectively - Easy address bar commands

You are already familiar with quite a few browser address bar shortcuts. For instance, type some text in the address bar of your browser (e.g. apple), press Ctrl + Enter and the browser will automatically send you to the corresponding .com website (in this case, www.apple.com) Or type in some complex search query (e.g., site:firefox.com internet explorer) in the address bar, hit go and the browser will show results from your default search engine*. The address bar of Google Chrome is even smarter as it can offer live suggestions while you are typing the search query.
Other than these built-in shortcuts, you may also want to know about a couple of URL hacks (a better term would be "address bar commands") that let you do stuff from the address bar itself  – they are pretty easy to remember and don't require you to install any bookmarklets or add-ons (so you can use them on any computer and even some mobile phones).

1. Download videos from Youtube with URL Change easily – If …

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…

Free Softwares , freewares : 16 July 09

Recover Files

Recover Files can undelete/recover deleted files. Its features
include: recovers files after deletion in the Recycle Bin, files
deleted from a network share, DOS command prompt, Shift+Delete is
used, when Move or Cut command are used, from Hard drives, floppy
disks, external USB disk / flash drivers, deleted by other
applications or by viruses, and much more; Supports FAT16, FAT32, NTFS
and NTFS 5 file systems; Performs non-destructive and read-only scan
and file recovery; Restores original create and modified file dates;
Supports unicode and non-alphabet languages; Filters files by name,
extension, folder and file type.

The 1.16 MB Recover Files, version 3.10 (July 06, 20079) for Windows
Vista, Windows 2003, Windows XP, Windows 2000, Windows 95, 98, ME and
Windows NT 4 can be downloaded at http://www.UndeleteUnerase.com/download.html

Exl-Plan Free

Exl-Plan Free is an Excel-based business finance planner, can be used
either for immediate or later projections, by both s…

MobileComm Recruits Freshers

Freshers IT Job Opening at MobilecommExperience: 0 - 1 Years 

Location: Delhi/NCR

Education: 
UG - B.Tech/B.E. - Computers, Electrical, Electronics/Telecomunication, Instrumentation   
PG - Post Graduation Not Required 

Industry Type: Telcom/ISP

Functional Area:
IT-Support, Telecom, Hardware

Job Description: 


*GSM Fundamentals. *RF Planning & Optimization. *Transmission Planning & Optimization. *3G Technologies
Desired Candidate Profile

B.E./B.Tech E&C, Telecommunication, Computers, IT 0 to 1 Yrs. experience Willing to work in GSM Mobile Industry Willing to travel anywhere in India Willing to undergo Job Oriented Training on self support basis
Company Profile
MobileComm Technologies (India) Pvt. Ltd. is subsidiary of MobileComm Professionals, Inc. USA - MobileComm Professionals Inc. is an engineering services organization supporting telecom cellular operators and OEM's to design, deploy and manage wireless networks. MobileComm is ISO9001 certified organization offering comp…

PDFzen: Simple document sharing.

PDFzen

You don't need to create an account to use PDFzen. Just upload your document and start editing. When you are finished, you can download the document as a PDF or get the link to share via email or social media. HTML5 PDF editing means PDFzen works right from the browser of your iPhone or iPad.

Features

Share
Easily share your document in many different ways.

Sign or Draw
Sign or draw anywhere on a document with the draw tool.

Type
Use the type tool to type on any part of a document.

Highlight
Point out important areas.

File Formats
.pdf, .doc, .docx, .xls, .xlx, .odt, .rtf)

Mobile-friendly
View and edit your PDFs on your PC, your phone, or your tablet.

Need to scan to PDF?
Use deskPDF Reader to scan your documents into PDF format, fill out forms, and easily share them with PDFzen integration.

Wallet_friendly

PDFzen will always be free to mark up, share and collaborate on documents. No strings attached, aver the developers

Check it out at https://pdfzen.c…

IBM Weekend Hiring for Java Professionals - 24th Nov 2012

Urgent Hiring Requirements for Java Professionals

Dear IBMer,

We solicit your help in bringing your friends and family members who qualify to apply for the given positions only.
We need your help & support to close the below positions. Please refer us good profiles like yours only & help us in closing the requirement.

Requirements Summary:

Please adhere to the demand:--

Skill -Java/J2EE with Spring/Hibernate/Struts
Exp Range - 3 to 4 yrs only (Please do not refer above 4yrs and below 3yrs as we will not be able to call them for the interview)
Joining Location - Pune/Kolkata/Chennai/Hyderabad

Interview Location - Bangalore/Chennai/Kolkata
Interview Date - 24th Nov 2012 (Only)


Important Note:Please refer to the above demand and share the profiles only for them to get the Interview Process started Immediately.Looking forward to your support to help us close these demand through Employee Referral only.16 years of Education is mandatory.Please check with the candidates that whether they have …

Contact Form

Name

Email *

Message *