Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
A: The Collections API is a set of classes and interfaces that support operations on collections of
objects.
Q: I am trying to store an object using a key in a Hashtable. And some other object already
exists in that location, then what will happen? The existing object will be overwritten? Or
the new object will be stored elsewhere?
A: The existing object will be overwritten and thus it will be lost.
Q: What is an enumeration?
A: An enumeration is an interface containing methods for accessing the underlying data structure
from which the enumeration is obtained. It is a construct which collection classes return when you
request a collection of all the objects stored in the collection. It allows sequential access to all the
elements stored in the collection.
Q: Considering the basic properties of Vector and ArrayList, where will you use Vector and
where will you use ArrayList?
A: The basic difference between a Vector and an ArrayList is that, vector is synchronized while
ArrayList is not. Thus whenever there is a possibility of multiple threads accessing the same
instance, one should use Vector. While if not multiple threads are going to access the same
instance then use ArrayList. Non synchronized data structure will give better performance than the
synchronized one.
1)What is OOPs?
Ans: 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.
10)What is casting?
Ans: 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?
Ans: 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?
Ans: While defining method, variables passed in the method are called parameters.
While using those methods, values passed to those variables are called arguments.
15)What is UNICODE?
Ans: Unicode is used for internal representation of characters and strings and it
uses 16 bits to represent each other.