Вы находитесь на странице: 1из 5

Chapter 1 Introduction All About Networks The primary purpose of a network is resource sharing, which means a computer can

share its resources, like data, memory, software, hardware, CPU, etc. with other computers on the network. In the network, one computer may ask the other computer for some service. The computer, which requests for some service is called client & the other computer, which provides that service to the client is called server. A network can have several clients & servers & such a network architecture is also called a client/server architecture.

Client

Server

Client sends request for service. Server sends response to client. Interview Question What is the advantage of a network? The main advantage of a network is that it makes resource sharing possible among the connected systems, thus helping in better utilization of resources. Following are the requirements for setting up a network of computers: 1) Hardware: Computer systems, Network Interface Cards (NIC), cables, modems, hubs etc. 2) Software: Any software, which supports networking features, like Unix, Linux etc so that data can be sent or received. 3) Protocol: It can be defined as a standard procedure for regulating data transmission between computers.

What Comprises the Internet?


The Internet is a global system of interconnected computer networks that use the standard Internet protocol suite (TCP/IP) to serve several billion users worldwide. It is a network of networks that consists of millions of private, public, academic, business, and government networks, of local to global scope, that are linked by a broad array of electronic, wireless and optical networking technologies. The Internet carries an extensive range of information resources and services, such as the inter-linked hypertext documents of the World Wide Web (WWW) and the infrastructure to support email.

Going back to history of Internet in 1969, DoD (Department of Defense), which is a US military defense department, got 4 computers which they connected with a cable & UNIX was installed on them. This is the first network on earth, which is also called ARPANET (Advanced Research Project Agency Network).

Fig. ARPANET, the first network Later on, NSFNET (National Science Foundation) (NSF) encouraged individual users to get connected into this network. Any user can simply connect his computer into this network by using a cable. A network of computers within an organization is called Intranet. An external network connecting an organizations network with that of another organization is called Extranet. Similarly, an organization may use the services of a third party private network to communicate with outside networks. This third party private network is called VAN (Value Added Network).

How does Internet Function? Like any network, Internet also requires certain hardware, software & protocols to perform its functions. The computer, which is connected to Internet Service Providers (ISP) computer is called client & the ISPs computer is called server. A client machine & a server machine on Internet also need software. The software that is installed on an Internet client is called Web Browser. Popular web browsers are Internet Explorer, Netscape Navigator, Mozilla Firefox, Google Chrome etc. The software that is installed on an Internet server machine is called Web Server. There are several Web servers, like IIS (Internet Information Server), Web Logic, Web Dynamics, Apache, JBoss, etc. Apart from software, protocols are also used on Internet. The most widely used protocol on Internet is HTTP, which stands for Hypertext Transfer Protocol. HTTP is responsible for displaying the html pages

(or Web Pages) on your client machine when you browse Internet. When you download a file from Internet to your client machine, you are using FTP (File Transfer Protocol). When you send mails, SMTP (Simple Mail Transfer Protocol) is used, and while receiving mails POP (Post Office Protocol) is used.
Every computer that is connected to the Internet is part of a network, even the one in your home. For example, you may use amodem and dial a local number to connect to anInternet Service Provider(ISP). At work, you may be part of a local area network (LAN), but you most likely still connect to the Internet using an ISP that your company has contracted with. When you connect to your ISP, you become part of their network. The ISP may then connect to a larger network and become part of their network. The Internet is simply a network of networks. Most large communications companies have their own dedicated backbones connecting various regions. In each region, the company has a Point of Presence (POP). The POP is a place for local users to access the company's network, often through a local phone number or dedicated line. The amazing thing here is that there is no overall controlling network. Instead, there are several high-level networks connecting to each other through Network Access Points or NAPs.

Software Development for Internet Suppose we are writing a C program with the name x.c. This means x.c file contains source code. When we compile this program, we get x.obj file that contains machine language code, which is just equal to the source code in x.c file. For example, this x.obj file contains the first statement to include a header file, like <stdio.h>. When we run the program, C compiler goes to the C standard library & searches for the header file <stdio.h> there. When the header file is found, C compiler copies the entire code (this code will be in machine language format) file contains 200 lines, then the total size of the file will be 210 lines. This file is also called x.exe file. This file is full-fledged file that contains the entire program in machine language instructions. These instructions are understandable to the microprocessor. So it executes them & gives the results.

Features of Java 1) Simple:- Because it has to work on electronic devices, where less memory is available.

Why pointers are eliminated from Java?


1.Pointers lead to confusion for a programmer. 2. Pointers may crash a program easily, for example, when we add two pointers, the program crashers immediately. 3. Pointers break security. Using pointers, harmful programs like Virus and other hacking programs can be developed. Because of the above reasons, pointers have been eliminated from java.

2) Object Oriented:- This means Java programs use objects & classes. An object is anything that really exist in the world & can be distinguished from others. Every object has properties & exhibits certain behavior. Let us understand this by taking an example of a dog. It got properties like name, height, color, etc. These are represented as variables. Now, the object dog will have some actions like running, barking, eating, etc. These actions are are represented as various methods (functions) in our programming. So, we conclude that object contains variables & methods. A group of objects exhibiting same behavior (properties + actions) will come under the same group called a class. A class represents a group of name given to several objects. For example, take the dogs Tiger, Tomy, Sheru. All these exhibit same behavior & hence belong to the same group, called dog. So dog is the class name, which contains these three objects. In other words class define as a model or a blueprint for creating the objects.

Properties vars

Properties vars

name height color age

Tiger 1 foot Brown

Actions methods Running Barking

actions methods Run() Bark()

Eat() Eating Let us take an example, Flower is a class but if we take Rose, Lily, Jasmine they all are objects of flower class. The class flower does not exist physically but its objects, like Rose, Lily, Jasmine exist physically.

What is the difference between a function and a method?

Ans). A method is a function that is written in a class. We do not have functions in java; instead we have methods. This means whenever a function is written in java, it should be written inside the class only. But if we take C++, we can write the functions inside as well as outside the class. So in C++, they are called member functions and not methods.

Is java a purely object oriented language or not?

Following reasons are put forward by the people to say Java is not a purely object oriented programming language: Purely object Oriented means it should contain only class & objects. It should not contain primitive datatypes like int, float, char, etc, since they are neither classes & objects. In pure object oriented languages, we should access everything by message passing (through object). But, Java contains static variables & methods which can be accessed directly without using objects. Java does not contain multiple inheritance. It means an important feature of object oriented design is lacking. No doubt Java is a purely object oriented programming language. The preceding points represents lack of understanding of java: Even if Java has primitive datatypes, these types are used inside the class & never outside of it. So, they are part of class. Even static variables & static methods are written inside a class. When accessing them outside, we should use classname. For reducing memory utilization, only one copy of them will be created in memory & shared by all the objects. Any purely object oriented language should follow all the five features of OOPS. They are 1. Classes & objects 2. Encapsulation 3. Abstraction 4. Inheritance 5. Polyporphism. Java contains all these features But just because Java does not contain multiple inheritance, we should not say it is not purely object oriented language. It is not the main feature of OOPS, it is only a sub feature under inheritance. 3) Distributed:- Using Java, we can write programs, which capture information & distribute it to the clients. This is possible because Java can handle the protocols like TCP/IP & UDP. 4) Robust:- means strong. Java programs are strong & they dont crash easily like C or C++ program because of two reasons. Firstly, Java has got excellent inbuilt exception handling features. An exception is an error that occurs at run time. If an exception occurs, the program terminates abruptly giving rise to problems like loss of data. Overcoming such a problem is called exception handling. This means that even though an exception occurs in a java program, no harm will happen.

Вам также может понравиться