Content-Length: 3149536 | pFad | https://www.scribd.com/document/546902671/TSF-2
5TSF
TSF
TSF
Q) What is Encapsulation?
Answer: Encapsulation provides objects with the ability to hide their internal characteristics
and behavior. Each object provides a number
of methods, which can be accessed by other objects and change its internal data. In Java,
there are three access modifiers: public, private and protected. Each modifier imposes
different access rights to other classes, either in the same or in external packages.
Some of the advantages of using encapsulation are listed below:
• The internal state of every objected is protected by hiding its attributes.
• It increases usability and maintenance of code, because the behavior of an object can be
independently changed or extended.
• It improves modularity by preventing objects to interact with each other, in an undesired
way.
You can refer to our tutorial here for more details and examples on encapsulation.
Q) What is Polymorphism?
Answer: Polymorphism is the ability of programming languages to present the same
interface for differing underlying data types. A polymorphic type is a type whose operations
can also be applied to values of some other type.
Q) What is Inheritance?
Answer: Inheritance provides an object with the ability to acquire the fields and methods of
another class, called base class. Inheritance provides re-usability of code and can be used to
add additional features to an existing class, without modifying it.
Q) What is Abstraction?
Answer: Abstraction is the process of separating ideas from specific instances and thus,
develop classes in terms of their own functionality, instead of their implementation details.
Java supports the creation and existence of abstract classes that expose interfaces, without
including the actual implementation of all methods. The abstraction technique aims to
separate the implementation details of a class from its behavior.
Q) What is the query used to display all tables names in SQL Server (Query analyzer)?
Answer: select * from information_schema.tables
Q) What is Externalizable?
Answer: Externalizable is an Interface that extends Serializable Interface. And sends data
into Streams in Compressed Format. It has two methods, writeExternal(ObjectOuput out)
and readExternal(ObjectInput in)
Q) How many types of JDBC Drivers are present and what are they?
Answer: There are 4 types of JDBC Drivers
Type 1: JDBC-ODBC Bridge Driver
Type 2: Native API Partly Java Driver
Type 3: Network protocol Driver
Type 4: JDBC Net pure Java Driver
Fetched URL: https://www.scribd.com/document/546902671/TSF-2
Alternative Proxies: