TCS Papers: Sample Questions 307 - 309 of 502

Examrace Placement Series prepares you for the toughest placement exams to top companies.

Question number: 307

» Basic CS » Operating System

Short Answer Question▾

Write in Short

How can you instantiate a tuple?

Explanation

Using one of the following:

  • Using the new operator. For example,

    • Tuple < String, int > t = new Tuple < String, int > (“HelloFriends”, 2);

    • Using the Create factory method available in the Tuple class. For example,

  • Tuple < int, int, int > t = Tuple. Create < int, int, int > (5,7, 8);

Question number: 308

» Basic CS » Networks

Essay Question▾

Describe in Detail

What is a Link?

Explanation

  • A link is a connection between two devices.

  • At the lowest level, a network can consist of two or more computers directly connected by some physical medium such as coaxial cable or optical fiber. Such a physical medium is called a link.

  • Link is the physical and logical network component to interconnect hosts or nodes in the network.

  • Link protocols provide suite of methods and standards that operate between adjacent network nodes of a local area network segment or a wide area network connection.

Image shows the Link

Image Shows the Link

Given the image is define the link two or more computers directly connected.

Question number: 309

» Languages » C & C Plus Plus

MCQ▾

Question

Which of the following concepts means wrapping up of data and functions together?

Choices

Choice (4) Response

a.

Inheritance

b.

Polymorphism

c.

Abstraction

d.

Encapsulation

Answer

d.

Explanation

  • Encapsulation is wrapping up of data and functions together- class in C++ is the wrapper.

  • Encapsulation thus encloses function and members within classes. Objects contain these attributes and the methods.

  • Data and functions thus form a single unit.

Image of the Encapsulation

Image of the Encapsulation

Given the image is define the encapsulation