Monday, October 4, 2010

Abstract in Java

abstract class shape

 {
    double area;
    final double phi=22.0/7.0;
    abstract double Area();
 }
class Rectangle extends shape
 {
    double length,breadth;
    Rectangle(double x,double y)
        {
            length=x;
            breadth=y;
        }  
    double Area()
        {
            area=length*breadth;
            return area;
        }
}
class Circle extends shape
 {
    double radius;
    Circle(double r)
    {

        radius =r;
    }
    double Area()
    {

        area = phi*radius*radius;
        return area;
    }
 }
class Abstractdemo
{
    public static void main(String args[])
    {
        Rectangle rec = new Rectangle(6.0,4.0);
        double ar;
        ar=rec.Area();
        System.out.println(+ar);
        Circle cr = new Circle(5.25);
        ar = cr.Area();
        System.out.println(+ar);
    }
}

      
       

 

Method Of communication

Methods of Communication
(Verbal and non-verbal communication)
Since thoughts and messages cannot be directly sent from the mind of the sender to the mind of the receiver, some medium or channel has been used. Here these channels or methods of communication have been discussed in details.
Verbal Communication:
Any communication that makes use of words, whether written or spoken, can be said to be verbal communication. Or, as Bartol and Martin put it, “verbal communication is the written or oral use of words to communicate”. All business organisations make extensive use of both oral and written communication.
Oral Communication:
When we communicate with the help of spoken words we call it oral communication. Thus, conversations, meeting conferences, interviews, training sessions, speeches, public address systems, announcements, radio speeches, telephone talk, public speaking etc are all forms of oral communication. For a professional it is very important that he should be able to communicate effectively with the spoken words as written communication takes up more time. Oral communication is used effectively to inform, satisfy, praise, criticise, please, inquire, and a variety of other purposes.
How to Make Oral Communication Effective:
To make the oral communication effective, a communicator should satisfy the following requisites.
The first requisite of effective oral communication is that he words should be clearly and properly pronounced. Poor voice control and poor pronunciation act as barriers to communication and they also distract the attention from the message itself. Indian languages, being phonetic in nature, does not pose as great a problem as English does from the point of view of pronunciation. To make oral communication in English effective, a communicator should try to cultivate Received Pronunciation (RP – the pronunciation of educated people in the south of England).
The second requisite of effective oral communication is clarity and precision. The person who speaks must have a good vocabulary at his disposal and should able to convey his message without any confusion of meaning.
The third requisite of effective oral communication is brevity. The speaker should use only the number of words necessary to convey his meaning. Over-communication is one of the
commonest defects of oral communication and should be guarded against. For example, while making a speech it is difficult to hold the attention of the audience after half an hour and unless the speaker knows how to make his speech brief, he will only be succeeded in boring his audience.
A proper tone is the fourth requisite. Not only the words but also the feelings with which you say affect the person who is listening to you. You should avoid sounding conceited to your subordinates.
Use of correct pitch is the fifth requisite of effective oral communication. Pitch is the way your voice moves up and down. To hold the attention of you listeners, the pitch must be changed time to time or else you will sound monotonous and boring.
The sixth and the last requisite of effective oral communication is the right registers. By register we mean using right style and vocabulary to suit the situation and the listener. People use different registers depending on their social, cultural and educational backgrounds. An effective oral communicator tries to adjust his speech according to requirement of his listeners.
Paralanguage is a type of non-verbal communication but it is being mentioned under the head of oral communication as it is a natural accompaniment of spoken language. It is not only what we say but how we say it that conveys the message.
Advantages and disadvantages of oral communication:
Oral communication has several distinct advantages which are listed below:
1. Proper shade of meaning can be conveyed. With the help of proper tone, pitch and intensity of voice, a speaker can put additional meaning into the words or entirely change their sense. We can convey anger, laughter, annoyance and several other feelings by the way we speak the words. All this is not possible in written communication.
2. Oral communication saves time. Words are understood as soon as they are spoken.
3. In oral communication feedback is immediate. As the words are received as soon as they are spoken the receiver of the message immediately gives his reactions and responses.
4. The speaker can be persuasive and carry conviction. Judging by the replies of the opposite person (receiver), the communicator can shift and change his arguments to make them carry conviction and persuade the listener.
5. It saves money. As many oral situations are face to face, no gadgets stationary or machinery is needed to convey the message.
6. Oral communication is less formal.
7. It makes communication of confidential and secret information possible. There are many things which cannot be put down in writing and for such delicate and confidential matters oral communication is best.
8. Oral communication can also be used to communicate with groups as at public meetings, assemblies, gatherings etc.
9. It allows the emergence of spontaneous ideas.
The following are the disadvantages or limitations of Oral Communication:
1. It can be misunderstood or misinterpreted more easily than written communication. As it is received as soon as it is spoken, it is not possible to refer to the message again.
2. It has little value from a legal point of view as there is no permanent record or proof of what has been said. Even tape recordings are not always accepted in the courts of law.
3. It is useless for long distance communication unless the gadget like telephone or radio is used.
4. Only a good speaker can communicate effectively.
5. It is not helpful for lengthy communications of an official or legal nature as something vital is likely to be missed out by the receiver of the message.
6. People cannot retain oral messages for a long time. Even in the process of receiving the message, only half of it might be understood and less than half of it is likely to be retained or remembered.
7. When message is transmitted orally it is not possible to pinpoint responsibility.
8. Its effectiveness is dependent on writing skill. What is said has often o be supplemented by something in writing before proper implementation.
Written Communication:
Like oral communication, written communication is a type of verbal communication. Writing is the expression of human language by means of visible signs. Hence arithmetic figures and words formed with the help of alphabets are both writing.
Before modern electronic gadgets were invited, letter writing was considered the only reliable means of communication. For a long time in the business world it was believed that sending letters, memoranda, and notices was the only proper way for businessmen to communicate. Today modern businessmen realize the advantages of using telephones, intercom, fax, telex, emails etc. but for obvious reasons the importance of business letters has not been greatly reduced. Written communication has definite and distinct advantages over oral and other types of communication.
Comparison of oral and written communication:
1. Written communication provides permanent record. It can be filed for years as an evidence of a transaction or agreement which is not possible in oral.
2. Oral messages are sometimes misunderstood. Written messages are less likely to be misunderstood as in case of doubt they can be read again.
3. In written communication feedback is slow and delayed whereas in oral communication feedback is immediate.
4. Written communication is slow and time consuming. Oral communication is quick.
5. Written communication is formal and tends to be rigid. Oral communication is informal and makes for friendly communication.
6. Written communication can reach only the literate people. Oral communication can be used effectively while communication with semi-literate and even illiterate people.
7. Written communication is accurate. Oral communication tends to be casual and sometimes inaccurate.
8. Information in writing can be disseminated or circulated widely with the help of printing and duplicating machines. Oral communication is usually person to person.
9. Message of a legal and financial nature are best communicated in writing as they can be understood clearly and can be filed. Oral communication is best for brief messages and orders.
10. Written communication makes it possible to fix responsibility. In oral communication it is difficult.
11. Language used in written communication is less subject to change than the language we use in oral communication.
12. Writing depends on the use of symbols. The symbols have to be selected with care and caution. Writing is therefore more difficult than speaking.
13. Written communication can be re-scrutinized even after period of time. This is not possible with oral communication.
14. Oral communication makes it possible for the sender of a message to convey his mood and emotions by the way he modulates his voice. There is no scope of conveying mood and emotions in written communication.
There are several types of written communication in business like e-mail message, memos, proposals, reports, letters, bulletins, minutes, orders, quotations, contracts, forms, enquires etc.
Non-Verbal Communication
Our five senses enable us to receive verbal and non-verbal communication. While driving on a highway our sense of smell tells us whether we have just passed a chemical or biscuit factory. In the same way we touch people to restrain them, warn them or nudge them in to silence. Non-verbal communication is not therefore, necessarily silent. It can be heard, tasted, smelled and felt.
Bartol and Martin define non-verbal communication as “communication by means of elements and behaviours that are not coded into words”. They go on to add that non-verbal aspects of communication account for 65 to 93 percent of what is communicated. Non-verbal
communication is very important because most people believe that the manner in which you say is more important than what you say.
Peter drucker says, “……..the most important thing in communication is to hear what isn’t being said”.
The way we move our body, change the expression on our face, gesticulate and even the way in which we pose, give definite message to other people. As these messages are not put into words we can call them uncoded or non-verbal messages. The undercover language of non-verbal communication has some ingredients like facial expression, eye contact, tone of voice, physical touch, appearance (clothes and hair), body/posture, proximity, physical gestures (hand nad foot movements), head position etc.
Facial Expression:
A facial expression results from one or more motions or positions of the muscles of the face. These movements convey the emotional state of the individual to observers. Facial expressions are a form of nonverbal communication. They are a primary means of conveying social information among humans
Charles Darwin believed that facial expressions show emotions which originated in our evolutionary past. It is because of that people from all over the world, even if they speak different languages; use a common pattern of facial expressions to show emotions. Universal facial expressions are used to show following emotions:
the list is endless
A good illustration of communication through facial expression would be the performance of a comedian. Top class comedian tells his jokes with a dead pan expressions that evokes more laughter than the words. In Asian countries like India the eyes have a special role to play in conveying messages.
Eye contact is a very important aspect on non-verbal communication. Everyone knows that people who are lying avoid eye contact. On the other hand, affixed stare can be rude, offensive and invasion of another person’s space. There can be no fixed rules as to how long one should look into another person’s eye while speaking. Every person has to work out on his own personal style.
Gesture:
Gesture is a movement or position of the hand, arm, body, head, or face that is expressive of an idea, opinion, emotion, etc. A gesture is a form of non-verbal communication in which visible bodily actions communicate particular messages, either in place of speech or together and in parallel with spoken words. Gestures include movement of the hands, face, or other parts of the body. Gestures differ from physical non-verbal communication that does not communicate specific messages, such as purely expressive displays, proxemics, or displays of joint attention. Gestures allow individuals to communicate a variety of feelings and thoughts, from contempt and hostility to approval and affection, often together with body language in addition to words when they speak.
We use gestures all the time: sometimes to point out something, sometimes to illustrate something what we are saying. The use of gesture is called gesticulation. The gesture we use in daily life are to many to be listed in detail:
1. Waving hands (greeting or good bye)
2. Upraised hands
3. Wagging index finger
4. Pointing index finger
5. Moving the hands side ways
6. Clenched fist
7. Shrugging shoulders
8. Starching a circle near the forehead with index finger - madness
Gestures are used for variety of purposes, sometimes they merely convey information, as when a person waves his hand in greeting. Sometimes they support speech, as when a person bangs his fist while speaking or moves his fingers to show that certain words are in “inverted commas” sometimes they show emotions like surprise or shock or anger (clenched fist). Sometimes they provide feedback as when person signals “no” to a message by moving a hand or head from side to side. Sometimes they reveal the personality as where a person moves forcefully or shakes hands firmly.
Body Language:
Body language is a form of non-verbal communication, which consists of body posture, gestures, facial expressions, and eye movements. Humans send and interpret such signals subconsciously. Borg attests that human communication consists of 93 percent body language and paralinguistic cues, while only 7% of communication consists of words themselves. By looking at a person and the shape of his body one can guess what kind of life s/he lives and what s/he is capable of.
In strict sense gestures are a part of body language as our head and hands are parts of our body. But we do use the body itself to convey messages and this is done separately of the movements of the hands and head.
Posture is an important element in body language as it often gives a key to the personality of the person and tells us a great deal about him or her. From the posture or the way the person holds himself we can know whether s/he is confident, diffident, young, old, strong or weak. A slouching posture means laziness, rounded shoulders and thrust neck indicate a scholarship, a swaggering or hands in the pocket posture could indicate overconfidence. The level of energy that a person exudes is also indicated by his posture and bearing.
People who specialize in such matters often read a lot of meaning in ordinary movements of the body. If a person sits on the edge of a chair it means he is cooperative and eager to please; if a person unbuttons his coat while talking it means he is perceptive to the ideas. If a person tilts his head while listening to the speaker it means he is interested in what is being said. Scratching the back of the head shows frustration and sometimes confusion; pointing the index finger while talking shows an assumption of authority or superiority. The list could be endless.

String Buffer Class

Simply stated, objects of type String are read only and immutable. Any modification to the String will have to create a new String object, while the String Buffer class is used to represent characters that can be modified at runtime.

String represents fixed-length, immutable character sequences. In contrast StringBuffer represents growable and writable character sequences.

This class provides many methods. For example the length () method gives the current length i.e. how many characters are there in the string, while the total allocated capacity can be found by the capacity () method. This is the capacity () function is used to know about the current characters kept which is displayed

Different Methods:

Capacity()
Insert()
Length()
Append()