0% found this document useful (0 votes)
24 views19 pages

MC7305

Internet communication protocols allow computers to communicate over the Internet using IP addresses and TCP. Each computer connected to the Internet has a unique IP address that identifies it and allows packets of information to be routed to it. Internet Service Providers (ISPs) provide Internet accounts and assign IP addresses. Domain Name System (DNS) converts hostnames like "www.example.com" to IP addresses for easier identification of Internet resources. E-mail addresses consist of a username and hostname separated by "@" to identify the sender and their mailbox. Formatted e-mail can include HTML, Rich Text Format (RTF), or MIME attachments.

Uploaded by

BARATH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views19 pages

MC7305

Internet communication protocols allow computers to communicate over the Internet using IP addresses and TCP. Each computer connected to the Internet has a unique IP address that identifies it and allows packets of information to be routed to it. Internet Service Providers (ISPs) provide Internet accounts and assign IP addresses. Domain Name System (DNS) converts hostnames like "www.example.com" to IP addresses for easier identification of Internet resources. E-mail addresses consist of a username and hostname separated by "@" to identify the sender and their mailbox. Formatted e-mail can include HTML, Rich Text Format (RTF), or MIME attachments.

Uploaded by

BARATH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

C.

ABDUL HAKEEM COLLEGE OF ENGG & TECH


DEPARTMENT OF COMPUTER APPLICATIONS

QUESTION BANK

SUBJECT: INTERNET PROGRAMMING CODE : MC7305

BRANCH: II M.C.A SEM : III

PART-A (2 MARKS)

UNIT-1

1)What is Internet communication protocols


• Computers connected to the internet communicate by using Internet Protocol (IP).
• IP slices information into packets and routes them to their destination.
• IP uses dynamic routing, so that even if one part of the network is knocked out,
packets can
be rerouted.
• Along with IP, most computers on the internet communicate with TCP.
2) Define Internet hosts
• Each computer on the internet is called a host computer or host.
• Computers on the internet are connected by cables, phone lines and satellite
connections.
• They include large mainframe, smaller mini computers and PCs.
3) What is IP Address
• Each host computer on the internet has a unique number called its IP address.
• IP addresses identify the host computers, so that packets reach the correct
computer.
• If we use dial-up account, ISP assigns your computer an IP address each time you
connect.
• Computers on LAN usually have IP addresses that are reserved for use on LAN.
• The most common IP assignment server is called DHCP (Dynamic Host
Configuration
Protocol).
4) Define Internet Service Providers (ISPs)
• It is an organization that provides Internet accounts.
• The other features provided by the Internet account are Email mailboxes, Web
server space
and Domain hosting.
5) What is Domain Name System
• The name of each host computer consists of a series of words separated by dots.
• The last part of the domain name is called the top-level domain (TLD).
• The last two parts of a host computer name constitute the domain.
• The second to last part of the name (second-level-domain) is chosen by the
organization
that owns the computer. Eg:yahoo.com
6) What is E-mail Addressing
• Internet e-mail addresses consists of two parts joined by @ sign.
• User name – It contains characters other than letters-they can contain numbers,
underscores, periods, and some other special characters. They can’t contain
commas or
parantheses.
• Host or domain name – It provides the internet location of the mailbox, usually the
name of
a company or internet service.
7) What is Formatted E-mail
• HTML – This is formatted with HTML tags, just like web pages. It includes text
formatting,
numbering, bullets, alignment, horizontal lines, backgrounds, hyperlinks. It is
actually sent
using the MIME protocol.
• Rich Text Format – This format can be read by most word processing
applications.
Documents in this format are also called RTF files.
• MIME (Multipurpose Internet Mail Extensions) – It is used for attachments.
Formatting
includes text formatting, pictures, video and sound.
8) What isWeb-Based E-mail
a. Using web based email we can access the web as well as read our mail.
b. Most web-based e-mail is free.
c. We can read two kinds of messages on the web :
i. Messages sent to a web-only account
ii. Messages stored in the POP mailbox
9) How will you Reduce Spam mail
• The term "spam" is Internet slang that refers to unsolicited commercial email (UCE)
or unsolicited bulk email (UBE).
• Some people refer to this kind of communication as junk email to equate it with the
paper junk mail that comes through the US Mail.
• Unsolicited email most often contains advertisements for services or products, but
very few reputable marketers use UCE to advertise.
10) How to avoid viruses
i. Do NOT open or view any attachment or file in email that you are not expecting.
Even if you know the person sending you a file, it does not mean that the file is safe.
ii. Newer email viruses can make it look as if your friends/colleagues are sending you
the file. In short, whenever you receive a file by email, CHECK with the sender
directly that the file is legitimate and if it is not, contact your IT support area.
iii. Following this rule will keep you safe from the vast majority of viruses going around the
internet.
11) What is Online Chatting
Online Chatting or online conferencing enables Internet users to exchange text or to have
discussions with groups of people in real time.
The groups of people involved may be anywhere in the world.
This group communication can take the form of text, voice, or video, and messages and
responses can be exchanged.
12) Real –time chat
Each participant sees each message with seconds of when it is sent, and the reply
is given quickly. However, all the participants need to be online at the same time.
13) Asynchronous chat
Messages are stored so that participants can read them when they have a chance,
which allow participants to consider their responses, gather information, and
formulate a response carefully. It also allows people from different time zones or
with different schedules to participate.
14) E-mail Mailing Lists - E-mail messages are sent to one or more people who are selected by
the sender. An e-mail mailing list allows messages to be distributed to a list of preselected
people, called subscribers.
15) Usenet Newsgroups - Usenet is a system that allows messages to be distributed throughout
the Internet. Due to the volume of messages, the messages are divided into newsgroups, or
topics.
16) Internet Relay Chat (IRC) - It allows thousands of internet users to participate in real-time
text-based chat.
17) Web-Based Chat - Many people are daunted by the programs and commands required by
IRC. Hence, many web sites now provide a web-based way to participate in real-time textbased
chat.
18) AOL and Compuserve Chat Rooms - AOL services allow real-time chat on a wide variety
of subjects.
19) Instant Messaging - Instant messaging (IM) is a form of online communication that allows
real-time interaction through computers or mobile devices.
20) Online conferencing - An online conference uses the Internet as a conference venue. This
means that participants can access the conference from anywhere in the world and can do this
at any time, using standard browser software.
21) What is IRC?
IRC (Internet Relay Chat) is a multi-user, multi-channel chatting system. We can use the
computer and talk through typed messages with either one person or many other people from all
over the Internet, all in real time.
22) What is File Transfer ?
In addition to talking, IRC has also become a popular and convenient way to exchange a
wide variety of files. Be forewarned, however, that many people are getting into serious trouble
by downloading files that seem interesting or enticing, only to find out they are attacks. These
hacks allow strangers to take over your channels, force you to disconnect, erase your hard disk,
or worse.
23) Define Instant message?
a. Instant messaging (IM) is a form of online communication that allows real-time
interaction through computers or mobile devices.
b. Although typed text remains the primary convention for IM, the technology now allows
users to send images, audio and video files, and other attachments.
c. Hundreds of millions of people use IM to stay connected. In many ways, it epitomizes
the notion of the always-connected, multitasking student, sending and receiving
messages at all hours, from a wide spectrum of devices, while doing several other
things at the same time.
24) What is Voice and Video Conferencing
• It can be PC-to-PC or PC-to-Phone, with two or more people in the conversation.
• It replaces conference calls, which get expensive when they include many people
over long distances.
• Voice conferencing enables user to send image to one or more people through a
camera attached to the computer and to receive pictures back.
• We can use voice or video conferencing (or both), depending on the peripherals
connected to the computer and the conferencing software

UNIT-2
1) What are the Java Features?
 Platform Independence
Object Oriented
Compiler/Interpreter Combo
Robust
Automatic Memory Management
Security
Dynamic Binding
Good Performance
Threading
Built-in Networking
2) What is Data Type ?
Data Types: It has Eight Simple Data types which can be put in four groups, they are:
Integers: byte, short, int, and long for whole valued signed numbers.
Floating-point numbers: float, and double for fractional precision.
Characters: char for representing symbols in character set.
Boolean: boolean a special type for representing true/false.
3) Define Variable ?
Variables: The basic unit of storage in Java Program. And is defined by the combination of an
identifier, a type, and an optional initializer. The syntax for declaring a variable is:
type identifier [= value] [ ,identifier [ = value]…]; e.g.: int a = 5, b=6;
4) Type Conversions and Casting:
a. Java’s Automatic Conversions:
i. The Two types are compatible.
ii. The destination type is larger then the source type.
b. Casting Incompatible Types:
i. Also called as narrowing conversions, since we are explicitly making the value
narrower so that it will fit into the target type.
ii. A cast is simply a explicit type conversion. The general form is (target type)
value e.g. int a; byte b; b = (byte) a;
5) Arrays:
a. An array is a group of variables of the same data type and referred to by a common
name. An array is contiguous block of memory locations referred by a common name.
E.g. char[] s;
Class[] Obj;
b. Like all objects we use the new keyword to create an array.
s = new char[10];
c. Types of Arrays:
i. One Dimensional Array.
type array_name []; //type is the datatype of the array.
ii. Multi – Dimensional Array.
type array_name = new type [rows] [cols];
6) What is Expressions?
In Java, arithmetic, boolean, and String expressions are written in conventional mathematical
infix notation, adapted to the standard computer character set (called ASCII).
7) What is Operators:
Java provides a rich operator environment. And it can be classified into four groups as:
a. Arithmetic: Used in mathematical expressions. They are: +, -, *, /.
b. Bitwise: It operates on individual bits of integer values. They are: &, |, ~,
c. Relational: It compares two values and determines the relationship between them. They
are: ==, !=, <, >, <=, and >=
d. Logical: It is an easy way to handle multiple conditions. They are: &&, || and, !.
8) What is Control Structures?
Statements that support repetition and conditional execution are called control statements or
control structures.
They are of two type: They are:
o Branching Statements: - They are If and Switch Statements.
o Looping Statements: - They are for, while, and do-while loops.
9) Define Classes?
Java classes contain fields and methods. A field is like a C++ data member, and a method is like a
C++ member function.
Each field and method has an access level:
private: accessible only in this class
(package): accessible only in this package
protected: accessible only in this package and in all subclasses of this class
public: accessible everywhere this class is available
Example: Class MyClass{
int RollNo; // Member Variable
String Name; // Member Variable
void getDetails(); // Member Function
void dispDetails(); // Member Function }
10) Define Object?
Objects are key to understanding object-oriented technology.
Object is an instance (or instantiation) of a class.
Three properties characterize objects:
o Identity: the property of an object that distinguishes it from other objects
o State: describes the data stored in the object
o Behavior: describes the methods in the object's interface by which the object can be
used
Example:
public static void main(String args[])
{
MyClass c1 = new MyClass(); //c1 is the Object of the Class MyClass
MyClass c2; // declare reference to Object
c2 = new MyClass(); //Allocate a MyClass Object
}
The new Keyword is used to allocate memory dynamically
11 ) Define Method?
A method is a set of Java statements which can be included inside a Java class.
They are similar to functions or procedures in other programming languages.
The only required elements of a method declaration are the method's return type, name, a pair
of parentheses, (), and a body between braces, {}.
The general from is
return-type method-name(parameters-list)
{
// body of the method
}
12) What is Constructor?
Constructors have one purpose in life: to create an instance of a class. This can also be called
creating an object
Constructors and methods differ in three aspects of the signature: modifiers, return type, and
name.
Like methods, constructors can have any of the access modifiers: public, protected, private, or
none.
Constructors cannot be abstract, final, native, static, or synchronized.

13) What is Garbage Collection?


The Java virtual machine's heap stores all objects created by a running Java application.
Garbage collection is the process of automatically freeing objects that are no longer referenced
by the program.
It relieves programmers from the burden of freeing allocated memory.
In addition to freeing unreferenced objects, a garbage collector may also combat heap
fragmentation.
Before an object is garbage collected, the runtime system calls its finalize() method.
It takes no arguments and returns no results. This method can be overridden to perform some
tidying up tasks when an object is garbage collected.
14) What is Method Overloading ?
The concept of defining two or more methods within the same class that share the same name, as
long as their parameter declarations are different is called as Method Overloading.
Each overloaded method must take a unique list of argument types.
When an overloaded method is called, java uses the type and/or number of arguments to decide
which version of the overloaded method to actually call.
15) What is Inheritance?
Inheritance is the capability of a class to use the properties and methods of another class while
adding its own functionality.
It has the following advantages:
you can customize and enhance working classes
it is easier to reuse code
you can take a more general class and modify to suit a particular situation
16) What is Method Overriding?
Method Overriding is achieved when a subclass overrides non-static methods defined in the
superclass, following which the new method implementation in the subclass that is executed.
17) What is Abstract Class?
An abstract class is a class that is declared abstract—it may or may not include abstract
methods. Abstract classes cannot be instantiated, but they can be subclassed.
An abstract method is a method that is declared without an implementation (without braces,
and followed by a semicolon), like this:
abstract void moveTo(double deltaX, double deltaY);
When an abstract class is subclassed, the subclass usually provides implementations for all of
the abstract methods in its parent class. However, if it does not, the subclass must also be
declared abstract.
18) What is Package?
A package is a grouping of related types providing access protection and name space
management. Note that types refers to classes, interfaces, enumerations, and annotation
types.
The types that are part of the Java platform are members of various packages that bundle
classes by function: fundamental classes are in java.lang, classes for reading and writing
(input and output) are in java.io, and so on.
To create a package, you choose a name for the package (naming conventions are discussed
in the next section) and put a package statement with that name at the top of every source
file that contains the types. E.g. package graphics;
19) Define Interface?
An interface is a group of related methods with empty bodies.
Implementing an interface allows a class to become more formal about the behavior it promises
to provide.
Interfaces form a contract between the class and the outside world, and this contract is
enforced at build time by the compiler.
If your class claims to implement an interface, all methods defined by that interface must
appear in its source code before the class will successfully compile.
20) What is Exception Handling:
An exception is an event that occurs during the execution of a program that disrupts the normal
flow of instructions.
When an error occurs within a method, the method creates an object and hands it off to the
runtime system. The object, called an exception object, contains information about the error,
including its type and the state of the program when the error occurred.
Creating an exception object and handing it to the runtime system is called throwing an
exception.
The set of possible "somethings" to handle the exception is the ordered list of methods that had
been called to get to the method where the error occurred. The list of methods is known as the
call stack
The runtime system searches the call stack for a method that contains a block of code that can
handle the exception. This block of code is called an exception handler.
UNIT-3
1) What is AWT Package:
AWT stands for Abstract Window ToolKit.
It is a portable GUI library between Solaris and Windows 95/NT and Mac System 7.X(soon) for
stand-alone applications and/or applets.
It provides many classes for programmers to use. It is your connection between your application
and the native GUI. The AWT hides you from the underlying details of the GUI your application
will be running on and thus is at very high level of abstraction.
2) What is Container ?
Containers:
a. Containers (Frames, Dialogs, Windows and Panels) can contain components and are
themselves components, thus can be added to Containers.
b. Containers usually handle events that occurred to the Components, although nothing
prevents you from handling events in the component.
c. The method of handling events in the Container (i.e. Frame) is preferred over the latter,
since we want to centralize event handling.
3) Define Component?
They are generally the stuff that the user interacts with.
Components are Buttons, TextAreas, Scrollbars, etc. in other words the visible UI
controls that the user interacts with, all of which have been added to a Container.
4) What is Layout Manager:
How Components are "laid out" within a Container is described by the LayoutManager class.
Since the LayoutManager class is abstract, we can not use it directly. We must sub-class it and
provide our own functionality or use a derived class of LayoutManager (i.e. BorderLayout,
CardLayout, GridLayout, etc) already created for us.
5) What are the Types of Layout?
Types of Layout available are:
a. Flow Layout: It is the default layout manager for most components. It lays out
components horizontally,
b. BorderLayout: Arranges up to five components in five positions: Center, East, West,
North, and South.
c. GridLayout: Place components in a Row vs Column matrix. Components fill slots starting
on top row, left to right, then move to next row down.
d. GridBagLayout: The most powerful layout manager is the GridBagLayout shown below.
It is very useful when you have an elaborate interface with lots of components.
GridBagLayout places a component according to the settings in an instance of the helper
class GridBagConstraints.
6) Event Package:
The java.awt.event package defines classes and interfaces used for event handling in the AWT
and Swing. The members of this package fall into three categories:
Events
The classes with names ending in "Event" represent specific types of events,
generated by the AWT or by one of the AWT or Swing components.
Listeners
The interfaces in this package are all event listeners; their names end with
"Listener". These interfaces define the methods that must be implemented by any
object that wants to be notified when a particular event occurs. Note that there is a
Listener interface for each Event class.
Adapters
Each of the classes with a name ending in "Adapter" provides a no-op
implementation for an event listener interface that defines more than one method.
When you are interested in only a single method of an event listener interface, it is
easier to subclass an Adapter class than to implement all of the methods of the
corresponding Listener interface.
7) What is Action Event:
An object of this class represents a high-level action event generated by an AWT component.
Instead of representing a direct user event, such as a mouse or keyboard event, ActionEvent
represents some sort of action performed by the user on an AWT component.
The getID() method returns the type of action that has occurred.
8) What is ActionListener:
This interface defines the method that an object must implement to listen for action events on
AWT components.
When an ActionEvent occurs, an AWT component notifies its registered ActionListener objects
by invoking their actionPerformed() methods.
The general type is
public abstract interface ActionListener extends java.util.EventListener {
// Public Instance Methods
public abstract void actionPerformed (ActionEvent e);
}
9) What is Painting?
To understand how AWT's painting API works, helps to know what triggers a paint operation in a
windowing environment.
In AWT, there are two kinds of painting operations: system-triggered painting, and applicationtriggered
painting.
System-triggered Painting
App-triggered Painting
10) What is Multi-Threading
A thread executes a series of instructions. Every line of code that is executed is done so by a
thread. Some threads can run for the entire life of the applet, while others are alive for only a
few milliseconds.
The class java.lang.Thread is used to create and control threads.
. To create a thread, a new instance of this class must be created. However, the thread does not
start running right away. Thread.start() must be called to actually make the thread run.
There are two ways to create a thread:
Extend the Thread class. With this technique the new class inherits from the class
Thread. The thread can start running in the class's run method.
Implement the Runnable interface. This technique is probably more common than
extending the Thread class. It is not necessary to define a new class to run the thread.

UNIT-4
1) Utility Packages:
 The final Java package, java.util, contains a collection of utility classes.
The Utility Package of Java consist of the following components:
Collections framework
Legacy collection classes
Event model
Date and time facilities
Internationalization
Miscellaneous utility classes such as string tokenizer, random-number generator and bit
array
2) What is DataStructure Class
Data Structure Classes: Data Structure Classes are very useful classes for implementing
standard computer science data structures: including BitSet, Dictionary, Hashtable,
Stack and Vector. The Enumeration interface of java.util package is used to count
through a set of values.
Date: The Date class is used to manipulate calendar dates in a system-independent
fashion.
3) What is String Tokenizer ?
StringTokenizer: This StringTokenizer class is used to convert a String of text into its tokens.
4) What is Input Stream?
InputStream: The abstract class InputStream declares methods to read bytes from a particular
source. InputStream is the superclass of most byte input streams in java.io.
5)What is Output Stream ?
OutputStream: The abstract class OutputStream is analogous to InputStream; it provides an
abstraction
for writing bytes to a destination
6)Define Character Streams ?
Character Streams: The abstract classes for reading and writing streams of characters are Reader
and Writer.
Each supports methods similar to those of its byte stream counterpart—InputStream and
OutputStream, respectively.
Reader has a read method that returns a char as the lowest 16 bits of an int. And, Writer has
methods that write char arrays.
The character streams were designed after the byte streams to provide full support for working
with Unicode characters, and in the process the contracts of the classes were improved to make
them easier to work with.
7) What is Inner Class ?
There are four other types of classes, loosely known as inner classes, that can be defined in a
Java program. Used correctly, inner classes are an elegant and powerful feature of the Java
language.
8)What is Static Member ?
A static member class is a class (or interface) defined as a static member of another class.
A static method is called a class method, so, by analogy, we could call this type of inner class a
"class
class," but this terminology would obviously be confusing.
A static member class behaves much like an ordinary top-level class, except that it can access the
static
members of the class that contains it. Interfaces can be defined as static members of classes.
9) Define Anonymous classes?
An anonymous class is a kind of local class that has no name; it combines the syntax for class
definition
with the syntax for object instantiation.
While a local class definition is a Java statement, an anonymous class definition (and
instantiation) is a
Java expression, so it can appear as part of a larger expression, such as method invocation.
10) Java Database Connectivity:
Java Database Connectivity or in short JDBC is a technology that enables the java program to
manipulate data stored into the database.
JDBC is Java application programming interface that allows the Java programmers to access
database management system from Java code. It was developed by JavaSoft, a subsidiary of Sun
Microsystems.
JDBC is consists of four Components: The JDBC API, JDBC Driver Manager, The JDBC Test
Suite
and JDBC-ODBC Bridge.
JDBC is an API specification developed by Sun Microsystems that defines a uniform interface
for
accessing various relational databases. JDBC is a core part of the Java platform and is included
in
the standard JDK distribution.
11) JDBC Driver Manager:
The JDBC DriverManager class defines objects which can connect Java applications to a
JDBC
driver. DriverManager has traditionally been the backbone of the JDBC architecture.
Its main purpose is to provide a means of managing the different types of JDBC database
driver.
When opening a connection to a database it is the DriverManager' s role to choose the most
appropriate driver from the previously loaded drivers.
A Java program that uses the JDBC API loads the specified driver for a particular DBMS
before it
actually connects to a database. The JDBC DriverManager class then sends all JDBC API calls
to
the loaded driver.
12 ) What is Servlets?
Servlets are Java technology's answer to CGI programming. They are programs that run on a
Web server and build Web pages.
Java servlets are more efficient, easier to use, more powerful, more portable, and cheaper than
traditional CGI and than many alternative CGI-like technologies.
The Servlet API, contained in the Java package hierarchy javax.servlet, defines the expected
interactions of a Web container and a servlet.
12) Servlet containers
A Servlet container is a specialized web server that supports Servlet execution.
It combines the basic functionality of a web server with certain Java/Servlet specific
optimizations and extensions – such as an integrated Java runtime environment, and the ability
to automatically translate specific URLs into Servlet requests.
13 ) Remote Method Invocation:
Remote Method Invocation (RMI) facilitates object function calls between Java Virtual
Machines
(JVMs).
JVMs can be located on separate computers - yet one JVM can invoke methods belonging to an
object stored in another JVM. Methods can even pass objects that a foreign virtual machine has
never encountered before, allowing dynamic loading of new classes as required.
The first thing we need to do is to agree upon an interface, an interface is a description of the
methods we will allow remote clients to invoke. An interface is a method which contains
abstract methods
14) What is Event-Driven-Thread (EDT) in Swing?
Event-Driven-Thread or EDT is a special thread in Swing and AWT. Event-Driven Thread is
used to draw graphics and listen for events in Swing. You will get a bonus point if you able to
highlight that time consuming operations like connecting to database, opening a file or
connecting to network should not be done on EDT thread because it could lead to freezing GUI
because of blocking and time consuming nature of these operations instead they should be done
on separate thread and EDT can just be used to spawn those thread on a button click or mouse
click.

15) Does Swing is thread safe? What do you mean by swing is not thread-safe?
This swing interview questions is getting very popular now days. Though it’s pretty basic many
developer doesn't understand thread-safety issue in Swing. Since Swing components are not
thread-safe it means you can not update these components in any thread other than
Event-Driven-Thread. If you do so you will get unexpected behavior. Some time interviewer will
also ask what are thread-safe methods in swing which can be safely called from any thread only
few like repaint() and revalidate().

16) What are differences between Swing and AWT?


One of the classic java swing interview questions and mostly asked on phone interviews. There
is couple of differences between swing and AWT:

1) AWT component are considered to be heavyweight while Swing component are lightweights
2) Swing has plug-gable look and feel.
3) AWT is platform depended same GUI will look different on different platform while Swing is
developed in Java and is platform dependent.

17) Why Swing components are called lightweight component?


Another popular java swing interview question, I guess the oldest that is generally comes as
followup of earlier question based on your answer provided. AWT components are associated
with native screen resource and called heavyweight component while Swing components is uses
the screen resource of an ancestor instead of having there own and that's why called lightweight
or lighter component.

18) What is difference between invokeAndWait and invokeLater?


This swing interview question is asked differently at different point. some time interviewer ask
how do you update swing component from a thread other than EDT, for such kind of scenario we
use SwingUtilities.invokeAndWait(Runnable r) and SwingUtilities.invokeLetter(Runnable
r) though there are quite a few differences between these two, major one is invokeAndWait is a
blocking call and wait until GUI updates while invokeLater is a non blocking asynchronous call.
In my opinion these question has its own value and every swing developer should be familiar
with these questions or concept not just for interview point of view but on application
perspective. you can read more on my post How InvokeAndWait and InvokeLater works in
Swing

19) Write code for JTable with custom cell editor and custom cell renderer?
Now comes harder part of swing interviews, questions asked in this part of Swing interview is
mostly about writing code and checking developer’s capability of API familiarity, key concept of
swing code etc.

JTable is one of favorite topic of all Swing interviews and most popular questions on swing
interviews are from JTable why? Because here interviewer will directly asked you to write code
another reason is JTable heavily used in all Electronic trading GUI. GUI used for online stock
trading uses JTable to show data in tabular format so an in depth knowledge of JTable is
required to work on online trading GUI developed in Swing. While this question is just an
example questions around JTable are mostly centered around updating table, how do you
handle large volume of data in table, using customize cell renderer and editor, sorting table
data based on any column etc. so just make sure you have done quite a few handsone exercise on
JTable before appearing for any java swing interview in IB.

20) Write code to print following layout (mainly focused on GridBag layout)?
After JTable second favorite topic of swing interviewer is GridBagLayout. GridBagLayout in
swing is most powerful but at same time most complex layout and a clear cut experience and
expertise around GridBagLayout is desired for developing Swing GUI for trading systems. No
matter whether you are developing GUI for equities trading, futures or options trading or forex
trading you always required GridBagLayout. Swing interview question on GridBagLayout will
be mostly on writing code for a particular layout just like an example shown here. In which six
buttons A, B, C, D, E and F are organized in certain fashion.

21) How do you handle opening of database, file or network connection on a click of
button?
This one is one of the easy java swing interview question. Interviewer is interested on whether
you know the basic principle of Java GUI development or not. answer is you should not do this
operation in EDT thread instead spawn a new thread from actionListener or button and disable
the button until operation gets completed to avoid resubmitting request. Only condition is that
your GUI should always be responsive no matter what happens on network connection or
database connection because these operations usually take time.

22) Prediction of output of code?


This is another category of Swing interview questions asked in IB whether they will give you
code and asked what would be the output , how will the GUI look like. This type of question is
based upon how well you understand and visualize the code. Whether you are familiar with
default layout manager of various component classes or not e.g. default layout of JFrame is
BorderLayout. So do some practice of these kinds of java Swing interview questions as well?

23) Question around JList like Creating a Jlist component such which should contain all the
asset classes like stocks, futures, options and derivatives etc in form of String. But constraint
is JList should always be sorted in Ascending order except that all assets which begins with
"Electronic trading” appears on top?
This is an excellent java swing interview questions which is based on real world task and focus
on JList component, Sorting and customizing JList model. For sorting you can use comparable in
Java and by customizing the JList model you can display content as requested. Once you
successfully answer this question there may be some followup on customizing the color of cell
etc which can be done by customizing renderer.
UNIT-5

1) What is JavaBeans?
JavaBeans is a portable, platform-independent component model written in the Java
programming language, developed in collaboration with industry leaders. It enables developers
to write reusable components once and run them anywhere -- benefiting from the
platform-independent power of Java technology. JavaBeans acts as a Bridge between proprietary
component models and provides a seamless and powerful means for developers to build
components that run in ActiveX container applications.
2)What is a Bean? Why isn't a Bean an Applet?
JavaBeans components, or Beans, are reusable software components that can be manipulated
visually in a builder tool. Beans can be combined to create traditional applications, or their
smaller web-oriented brethren, applets. In addition, applets can be designed to work as reusable
Beans.
Individual Beans will function quite differently, but typical unifying features that distinguish a
Bean are:
• Introspection: enables a builder tool to analyze how a Bean works
• Customization: enables a developer to use an app builder tool to customize the
appearance and behavior of a Bean
• Events: enables Beans to communicate and connect together
• Properties: enable developers to customize and program with Beans
• Persistence: enables developers to customize Beans in an app builder, and then retrieve
those Beans, with customized features intact, for future use
3)Why are component architectures useful?
Developers are turning to creating components rather than monolithic applications to free
themselves from slow, expensive application development, and to build up a portable, reusable
code base. This enables developers to quickly attack new market opportunities, new joint
development opportunities, and new ways to sell smaller packages of software.
4)Is JavaBeans a complete component architecture?
JavaBeans is a complete component model. It supports the standard component architecture
features of properties, events, methods, and persistence. In addition, JavaBeans provides support
for introspection (to allow automatic analysis of a JavaBeans component) and customization (to
make it easy to configure a JavaBeans component).
5)Why a component architecture for the Java platform?
JavaBeans brings the extraordinary power of the Java platform to component development,
offering the ideal environment for a developer who wants to extend the concept of reusable
component development beyond one platform and one architecture to embrace every platform
and every architecture in the industry.
6)What kind of industry support exists for JavaBeans?
A coalition of industry leaders in component development worked with JavaSoft to create the
JavaBeans specification, which was released to the Internet for public comments on September
4, 1996. The "frozen" JavaBeans specification combines the work of Apple, Borland, IBM,
JustSystem, Microsoft, Netscape, Rogue Wave, SunSoft and Symantec and many, many others...
We're very pleased to see the tools community swiftly embracing JavaBeans by announcing
support for JavaBeans in their visual application builder tools.
7)Are there JavaBeans components available that I can buy today?
Yes. A large number of companies, both large and small, have announced their plans to deliver
JavaBeans-based products.
8)What is the relationship between Sun's JFCs and JavaBeans?
The JFC (Java Foundation Classes) is based upon the AWT (Abstract Windowing Toolkit),
which has been part of the Java platform from the beginning. JFC effectively adds a richer set of
visual elements for building JavaBeans components and applications. See the JFC web site for
more information.
9)What are the security implications for downloading Beans over the Internet?
JavaBeans does not add any security features to the Java platform. Rather, JavaBeans
components have full access to the broad range of security features that are part of the Java
platform. JavaBeans components can be used to build a range of different kinds of solutions from
full-fledged Java desktop applications to web-based Applets.
1. What is network? What are the three criteria necessary for an effective and efficient
network?
Network is a connected group of autonomous computers that are abided by some rules and also
where functionality is shared.
The most important criteria are performance, reliability and security.
Performance of the network depends on number of users, type of transmission medium, and the
capabilities of the connected h/w and the efficiency of the s/w.
Reliability is measured by frequency of failure, the time it takes a link to recover from the failure
and the network's robustness in a catastrophe.
Security issues include protecting data from unauthorized access and viruses.

2. What is meant by data communication?


Data communication is the exchange of data (in the form of 1s and 0s) between two devices via
some form of transmission medium (such as a wire cable).

3. What are the three fundamental characteristics determine the effectiveness of the data
communication system?
The effectiveness of the data communication system depends on three fundamental
characteristics:
Delivery: The system must deliver data to the correct destination.
Accuracy: The system must deliver data accurately.
Timeliness: The system must deliver data in a timely manner.

4. What are the advantages of distributed processing?


Advantages of distributed processing include security/encapsulation, distributed databases, faster
problem solving, security through redundancy and collaborative processing.

5. What are the types of network?


LAN, MAN and WAN

6. What are some of the factors that determine whether a communication system is a LAN,
MAN, or WAN?
Size, Ownership, the distance it covers and its physical structure

7. What is a protocol? Why are standards needed?


In networks, communication occurs between the entities in different systems. Two entities cannot
just send bit streams to each other and expect to be understood. For communication, the entities must
agree on a protocol. A protocol is a set of rules that govern data communication.

Co-ordination across the nodes of a network is necessary for an efficient communication. If there are
no standards, difficulties arise. A standard provides a model or basis for development to which everyone
has agreed.

8. For n devices in a network, what is the number of cable links required for a mesh and ring
topology?
Mesh topology - n (n-1)/2
Ring topology - n

9. What is the difference between a passive and an active hub?


An active hub contains a repeater that regenerates the received bit patterns before sending them out.
A passive hub provides a simple physical connection between the attached devices.

10. Distinguish between peer-to-peer relationship and a primary-secondary relationship.


Peer-to-peer relationship: All the devices share the link equally.
Primary-secondary relationship: One device controls traffic and the others must transmit through
it.

11. Assume 6 devices are arranged in a mesh topology. How many cables are needed? How many
ports are needed for each device?
Number of cables=n (n-1)/2=6(6-1)/2=15
Number of ports per device=n-1=6-1=5

12. Group the OSI layers by function.


The seven layers of the OSI model belonging to three subgroups. Physical, data link and network
layers are the network support layers; they deal with the physical aspects of moving data from one
device to another. Session, presentation and application layers are the user support layers; they allow
interoperability among unrelated software systems. The transport layer ensures end-to-end reliable
data transmission.

13. What are header and trailers and how do they get added and removed?
Each layer in the sending machine adds its own information to the message it receives from the
layer just above it and passes the whole package to the layer just below it. This information is added in
the form of headers or trailers. Headers are added to the message at the layers 6,5,4,3, and 2. A trailer
is added at layer2. At the receiving machine, the headers or trailers attached to the data unit at the
corresponding sending layers are removed, and actions appropriate to that layer are taken.

14. The transport layer creates a communication between the source and destination. What are
the three events involved in a connection?
Creating a connection involves three steps: connection establishment, data transfer and connection
release.

15. What is the DC component?


Direct current is a zero-frequency signal with constant amplitude.

16-MARKS
PART – B
UNIT-1

1) Write about Domain Name System


2) Explain Exchanging E-mail
3) Explain Sending and Receiving Files
4) Write about Fighting Spam, Sorting Mail and avoiding e-mail viruses
5) Write short notes on Chatting and Conferencing on the Internet
6) Write about Online Chatting
7) Explain Messaging
8) Write about Usenet Newsgroup
9) Explain Voice and Video Conferencing
10) Explain Web Security, Privacy, and site blocking
11) Write about FTP.

UNIT-2

1. Explain in detail about Java features


2. Write about Java Platform and Java Fundamentals
3. Write about Expressions in java
4. Explain Operators in java
5. Explain Control Structures in java
6. Write about Classes in java
7. Explain about Packages and Interfaces
8. Write short notes on Exception Handling in java.

UNIT-3

1. AWT package in java


2. Layouts in java
3. Containers in java
4. Event Package and Event Model in java
5. Explain about Painting
6. Garbage Collection in java
7. Explain Multithreading
8. Write short notes on Language Packages.

UNIT-4

1. Write short notes on Utility Packages in java


2. Input Output Packages in java
3. Explain Inner Classes
4. Explain Java Database Connectivity
5. Explain Servlets with example
6. Explain Remote Method Invocation
7. Explain Swing Classes in java.
UNIT-5

1. Explain about Java Beans


2. Explain Jar Files with commands
3. Explain BDKUsing BeanInfo Interface
4. Explain Java Beans API
5. Write short notes on InetAddress
6. TCP/IP Client Sockets
7. TCP/IP Server Sockets
8. Caching Proxy HTTP Server
9. Explain Datagrams.

You might also like