Sunday, November 22, 2015

One word substitution

One word substitution

one who is against the religion
Heretic
One who eats human flesh
Cannibal
One who lives at the same time
Contemporary
One who is more than a hundred years old
Centenarian
One who is given to pleasure of the flesh
Epicure
One who lives on others
Parasite
ONE WHO IS A HABITUAL DRUNKED
SOTTOPER
ONE WHO IS SETTLES IN ANOTHER COUNTRY
IMMIGRANT
ONE WHO KNOWS MANY LANGUAGES
POLYGOT
ONE WHO DEALS IN CATTLE
DROVER
ONE WHO CUTS PRECIOUS STONES
LAPIDIST(LAPIDARY)
ONE WHO CURE EYE DISEASE
OCULIST
ONE WHO SELLS SWEETS AND PASTRIES
CONFECTIONER
ONE WHO LOADS AND UNLOADS SHIPS
STEVEDORE
ONE WHO RETIRES FROM SOCITY TO LIVE A SOLITARY LIFE
RECLUSE
ONE WHO PRETENDS TO BE WHAT HE IS NOT
HYPOCRITE
A PROFESSIONAL RIDER IN HORSE RACES
JOCKEY
A NUMBER OF SHEEPS
FLOCK
A COLLECTION OF FLAGS
BUNTING
A NUMBER OF STARS GROUNDED TOGETHER
CONSTELLATION
THE HOUSE OF AN ARAB
DOWAR
A FACTORY FOR MANUFACTURING OF BEERS
BREWERY
A PLACE FOR THE COLLECTION OF DRIED PLANTS
HERBARIUM
A CASE IN WHICH THE SWORD IS KEPT
SHEATH
FREE FROM INFECTION
IMMUNE
THE DEAD BODY OF A ANIMAL
CARACASS
THE SCIENCE OF COLOURS
CHROMATICS
THE SCIENCE OF THE STRUCTURE OF HUMAN BODY
ANATOMY
THE ART OF EFFECTIVE SPEKING
ELOCUTION
THE STUDY OF ROCKS AND SOILS
GEOLOGY
THE STUDY OF MOUNTAINS
ORALOGY
THE STUDY OF LANGUAGES
PHILOLOGY
THE STUDY OF THE ORIGIN AND HISTORY OF WORDS
ETYMOLOGY
THE STUDY OF ANCIENT WRITING
PALEOGRAPHY
THE ART OF PRESERVING SKIN
TAXIDERMY
THE PERIOD BETWEEN TWO REIGNS
INTERREGNUM
A COUNCIL OF CLERGYMEN
SYNOD
THE CEREMONY AT WHICH A MAN BECOMES A PRIEST
ORDINATION
VIOLITING RELIGIOUS THINGS
SACRILIEGE
ONE WHO INTOLERANTLY DEVOTED TO A PARTICULAR CREED
BIGOT
ENGAGED TO BE MARRIED
BETRODTED
AN INSTRUMENT FOR RECODING THE REVOLUTIONS OF THE EARTH
GYROSCOPE
A POEM OF MOURNING
ELEGAY
A HOLLOW SPACE IN A WALL FOR A STUATE
NICHE
LANGUAGES THAT HAS BEEN VERY MUCH USED
HACKNEYED
CURRECT SPELLING
ORTHOGRAPHY
A VERY PRIVATE ROOM
SANCTUM,SANCTORUM
A PLACE WHERE MAD MEN ARE KEPT
LUNATIC
KILLING ONE’S FATHER
PATRICIDE
A MEDICINE THAT LOOSENS THE BOWELS
LAXATIVE
A SPEECH MADE TO ONESELF
SOLILOQUY
SEPARATION FROM OTHER PEOPLE TO AVOID INFECTION
QUARANTINE
AN IMAGINARY IDEAL
UTOPIA
A THING KEPT IN MEOMORY OF AN EVENT
SOUVENIR
COMMON PLACE REMARKS
PLATITUDES
BELIEF OF GOD IN NATURE
PANTHEISM
INCAPABLE OF BEING BURNT
INCOMBUSTIBLE
A PERSON SUFFERING FROM NERVOUS BREAKDOWN
NEUROTIC
AN INSTRUNMENT FOR MEASURING GASES
MANOMETER
AN EXAGGERATED STATEMENT
HYPERBOLE
ONE WHO IS COMPLETELY SATISFIED
COMPLACENT
SIMPLE AND EASILY DECEIVED
GULLIBLE
ONE WHO HAS DELUSIONS OF ONE’S GRANDEUR
MEGALOMANIAC
ONE WHO FLAUNTS NEWLY ACQUIRED WEALTH
PARVENU
WEARINESS OF AND SADNESS FOR LIFE AND WORLD
WELTSCHMERZ
BOREDOM AND FRUSTRATION IN LIFE
ENNUI
SHY,TIMID , UNWILLING TO FACE A SITUATION
DIFFIDENT
ONE WHO IS CHVALROUS,IDEALISTIC AND UNPRACTICAL
QUIXOTIC
ONE WHO IS GRAVE AND GLOOMY
SATURNINE
THE ACT OF ENJOYING OR HAVING AN EXPERIENCE INDIRECTLY
VICARIOUSLY
THE TENDENCY TO POSTPONE THINGS FOR FUTURE
PROCRASTINATION
TO RELAX IN A COUNTRYSIDE FAR AWAY FROM THE HUMDRUM OF TOWN
RUSTICATE
TO SPEND LIFE WITHOUT PURPOSE AND INTITATIVE
VEGETATE
A GIRL WHO FLIRTS EGREGIOUSLY
COQUETTLE
A WOMEN WHO LURES MEN TO DESTROY THEM
CIRCE
A TALL STRONG,MASCULINE KIND OF WOMEN
AMAZON
A LOUD-MOUTHED TURBULENT KIND OF WOMEN
VIRAGO
A TRAITOR WHO CAN SEL OUR EVEN HIS FIRENDS
JUDAS
UNDERSTANDING WITHOUT THE INTERFERENCE OF FEELINGS
EMPATHY
AN EMBARRASSING MISTAKE
A FAUX PAS
A MEDLEY OR HETEROGENOUS MIXTURE OF GREAT VARIETY
POTPOURRI
A SLANG OF THE UNDERWORLD
ARGOT
A LANGUAGE OF SPECIAL GROUP
PATOIS
THE ASCRIBING OF HUMAN MOTIVATION, CHARACTERUSTICS IFR BEHAVIOUR TO INANMATE OBJECTS, ANIMAL OR NATURAL PHENOMENA
ANTHROPORMORPHISM
A PAYMENT TO LEGALY BINDNG BUT FOR WHICH SOME MORAL OBLIGATION IS FELT
EX GRATIA
A WASHING OR CLEANSING OF THE BODY ESPECIALLY IN A RELIGIOUS CEREMONY
ABLUTION
SOMETHING PERFECTLY NEAT AND TIDY
IMMACULATE
A TREATISE ON ONE SUBJECT
MONOGRAPH
THE GROUP ESPECIALLY IN THE ARTS REGARDED A BEING THE MOST EXPERIMENT
AVANT-GRADE
AN OFFICIAL BULLETIN
COMMUNIQUE
A PASSAGE WITH ONLY ONE END
CUL-DE-SAC
THE ART OF PAINTING ON A PLASTER SURFACE
FRESCO
A RECORD OR TABLE SHOWING THE DESCENT OF A PERSON OR A FAMILY
GENEALOGY
A CONNOISSEUR OF FOOD AND DRINK
GOURMENT
A PERSON OR THING THAT GOES BEFORE AND ANNOUNES THE COMING OF SOMETHHING
HARBINGER
A PERSISTENT ANXIETY ABOUT ONE’S HEALTH USUALLY INVOLVING IMAGINED SYMPTOMS OF ILLINESS
HYPOCHONDRIA
AN ODD,A TYPICAL OR ECCENTRIC TRAIT
IDIOSYNCRASY
TO COMENASATE A PERSON ETC. FOR LOSS OR DAMAGE
LINDEMNIFY
A PLAN FOR OR ROUTE TO BE FOLLOWED ON A JOURENY
ITINERARY
A GROUP OF PEOPLE WHO BAND TOGETHER FOR SOME SECRET PURPOSE ESPECIALLY FOR POLITICAL INTRIGUE
JUNTA
A SHORT JOURENY FOR PLEASEURE
JAUNT
A SWIFTLY CHANGING SCENE OR PATTERN
KALEIDOSCOPE
A WRITTEN ATTACK USING HUMOUR TO PROVOKE CONTEMPT
LAMPOON
A FALSE WRITTEN STATEMENT TO DAMAGE A PERSON’S REPUTE
LIBEL
A PHARSE R SENTENCE THAT IS COMICAL OR NONCENSICAL BECAUSE THE SPEAKER USED A WRONG WOEK THAT SOUNDED SOMETHING LIKE A RIGHT WORD
MALAPROPISM
A FULLSIZE MODEL OF A COMPLETE OF PATIAL HUMAN FIGURE
MANNEQUIN /DUMMY
PERASONAL REMINISCENCES IN A NARRATIVE FROM
MEMOIR
A LONG WANDERING JOURNEY
ODYSSEY
A SPEECH OR WRITING PRASING A PERSON OR A THING
PANEGYRIC
A LOVER SPECIALLY ONE WHO UNLAWFULLY TAKES THE POSITION OF A WIFE OR A HUSBAND
PARAMOUR
AN EXPERESSION OF THE POPULAR WILL CONCERNING SOME IMPORTANT QUESTIONS GIVEN BY A DIRECT VOTE OF THE PEOPLE
PLEBISCITE
A PORTRAIT OF A PERSON WITH ONLY THE OUTLINE OF THE PROFILE
SILHOUETTE
CAUSING OR TENDING TO CAUSE SLEEP
SOPORIFIC
A SUBSUTUTE
SURROGATE
EXSISTING ONLY IN NAME
TITULAR
A SHORT LITERARY DESCRIPTION MARKED BY DELICACY
VIGNETTE
A LONG JOURENY ESPECIALLY BY SEA
VOYAGE
A PERSON WHO OPPOSES ANOTHER
ANTAGONSIT
A PERSON WHO IS VERY SELECTIVE DISGUSTED EASILY AND IS HARD TO PLEASE
FASTIDIOUS
SOMETHING THAT CAN NOT BE HARMED
INVIOLATE
FEAR OF CROWDS
OCLOPHOBIA
A FUNERAL BELL
KNELL
A PERSON WHO IS PURE AND CLEAN
IMMACULATE
A PERSON WHO IS FILLED WITH EXCESSIVE ENTHUSIASM
EXTROVERT
A PERSON WHO OS BAD IN SPELLING
CACAOGRAPHIST
A PERSON CLAMING TO BE SUPERIOR IN CULTURE AND INTELLECT TO OTHERS
HIGHBROW
A PERSON LEAVING HIS NATIVE COUNTRY TO SETTLE IN ANOTHER
EMIGRANT
A PERSON HAVING THE SAME NAME
NAMESAKE
A PERSON WHO IS TALKTIVE
GARRULOUS
SOMETHING THAT CANNOT BE TAKEN AWAY
INALIENABEL
ONE WHO TRAVELS FROM PLACE TO PLACE
TRAMP
TO MOVE ALONG WITH QUICK SHORT TWISTING ACTIONS
WRIGGLE
BE THE EMODIMENT OR PERFERCT EXAMPLE OF
CHARACTERISE
ONE WHO DERSERTS HIS RELIGION
APOSTATE
CUSTOM OF HAVING MANY WIVES
POLYGAMY
PERSON WHO BELIVES THAT GOD IS EVERYTHING AND EVEYTING IS GOD
PANTHEIST
RELATIONSHIP BY BLOOD OR BIRTH
CONSANGUINITY
BELIEF OR OPINION CONTRARY TO WHAT IS GENERALLY ACCEPTED
HERESY
A COUNTRY RULED BY TWO COUNTRY
CONDOMUNIUM
A LADY’S PURSE
RETICULE
A RELIGIOUS SONG
HYMN
A VERSE LETTER
EPISTLE
A ANIAML STORY WITH MORAL
FABLE
ART OF CUTTING TREE AND BUSHES INTO ORNAMENTAL SHAPE
TOPIARY
CHANGE ONE’S MIND TWO QUICKLY
VACILLATION
CONGRULATIONS SOME ONE IN FORMAL MANNER
FELICATATE
CREATURE HAVINGH BOTH MALE AND FEMALE ORGANS
HERMAPHRODITE
EQUAL IN RANK
PEER
FAULT THAT MAY BE FORGIVEN
VENIAL
FEAR OF BECOMING BLAD
PHALACROPHOBIA
Fear of pain
Aglophobia/odynophobia
Fear of getting fat makes young girl stop eating resulting in harmful effect
Anorexia
Fear of males
Androphobia
Fear of ugliness
Cacophobia
Fear of doctors
Catrophobia
Fear of depths
Bathopobia
Fear of dogs
Cynophobia
Extreme fear of beauty
Cellophobia
Fear of thirst
Dipsophobia
Morbid compulsion of drink
Dipsomania
Fear of work
Ergophobia
Fear of marriage
Gamophobia
Fear of birth
Genophobia
Fear of old age
Geraphobia
Fear of writing
Graph phobia
Fear of pleasure
Hedonophobia
Fear of travel
Hydrophobia
Fear of women
Gynophobia
Fear of getting fat
Lipophobia
Fear of childbirth
Maieusiphobia
Fear of snakes
Ophiopobia
FEAR OF BEING ROBBED
HARPAXOPHOBIA
FEAR OF COCKROACHES
KATSARIDAPHOBIA
Fear of darkness
Nyctophobia
Fear of ghosts
Phasmophobia
Fear of deaths
Thanatophobia
Fear of numbers
Triskaidekaphobia
FEAR OF DARK
LYGOPHOBIA
FEAR OF FAILURE
ATYCHIPHOBIA
FEAR OF GOD
ZEUSOPHOBIA
FEAR OF GOING TO BED
CLINOPHOBIA
FEAR OF POVERTY
PENIAPHOBIA
FEAR OF PROPERTY
ORTHOPHOBIA
FEAR OF RIDING A CAR
AMAXOPHOBIA
FEAR OF SEX
XENOPHOBIA
FEAR OF SPEED
LALOPHOBIA
FEAR OF WORDS
LOGOPHOBIA
FUNNY IMITATION OF A POEM
PARODY
GIVING UP THRONE BY THE KING
ABDICATION
GO BACK AND FORTH
SHUTTLE
GROUP OF THREE NOVALS
TRILOGY
LANGUAGE DIFFICULT TO UNDERSTAND
JARGON
LIST OF EXPLANTATION
GLOSSARY
LOUD TALK OR SPEECH
HARANGUE
MAN HAVING THE WOMAN’S QUALLITY
EFFEMINATE
MAN OF LAX MORAL
LICENTIOUS
MAN WHOSE WIFE IS UNFAITHFUL TO HIM
CUCKOLD
MANIA FOR TRAVEL
DROMOMANIA
MANIA OF BEING IMPORTANT
MEGALOMANIA
MEDICINE WHICH LESSENS PAIN
ANODYNE
MORNING PRAYER
MATIN
OLD AGE WHEN A MAN BEHAVE LIKE A FOOL
DOTAGE
ONE WHO COMES FROM A VILLAGE AND CONSIDERED STUPID
BUMPKIN
ONE WHO FIGHTS FOR MONEY
MERCENARY
ONE WHO FORSAKES RELIGION
RENEGADE
ONW WHO IS GUILTY OF FIRING PROPERTY
ARSONIST
ONE WHO IS VERY CAREFUL AND PARTICULAR
METICULOUS
ONE WHO PAYS TOO MUCH ATTENTION TO HIS CLOTHS AND APPEARANCE
DANDY
ONW WHO PRETENDS ILLNESS TO ESCAPE DUTY
MALINGERER
ONE WHO TALKS CONTINUOUSLY
LOQUACIOUS
ONE WHO WORKS IN RETURN FOR BEING TAUGHT THE TRADE
DISCIPLE
ONE WHOSE ATTITUDE IS TO EAT, DRINK AND MERRY
EPICUREAN
PEOPLE IN ROWDY SCENCE
RABBLE
PERASON OBSESSED WITH ONE IDEA OR SUBJECT
MONOMANIIAC
PERSON WHO DOES NOT BELIEVE IN ANY RELIGION
PAGAN
PERSON WHO HOLDS SCHOLARSHIP AT A UNIVERSITY
BURSAR
PERSON WHO IS AGAINST THE ORDINARY SOCIETY ESP. DRESSING
HIPPY
PERSON WHO IS ALWAYS DISSATISFIED
MALCONTENT
PERSON WHO LIVES ALONE AND AVOID OTHERS
RECLUSE
PERSON WHO LOVES NATURE
AESTHETE
PERSON WHO PRETENDS TO HAVE MORE KNOWLEDGE
CHARLATAN
PERSUASIVE AND FLUENT SPEECH
ELOQUENCE
PHYSICIAN WHO DELIVERS BABIES
OBSTERICIAN
PLACE WHERE COWS ARE SHELTERED
BYRE
PLACE WHICH PROVIDES BOTH BOARD AND LODGING
INN
POWER OF READING THOUGHTS OF OTHERS
TELEPATHY
RIDICULULOUS USE OF WORKS
MALAPROPISM
RIDE ON SOMEONE’S BACK
PIGGYBACK
ROOM LEADING INTO A LARGE ROOM
ANTEROOM
SEAT ON ELEPHANT’S BACK
HOWDAH
SONG SUNG AT BURIAL
DIRGE
THING THAT BRING GENTLE AND PAINLESS DEATH FROM INCURABLE DISEASE
EUTHANASIA
TO EXPLAIN A SPRITUAL TRUTH
BENIGN
TO DO AWAY WITH RULE
ABROGATE
TO EXPLAIN A SPRITUAL TRUTH
PARABLE
USING OF NEW WORDS
NEOLOGY
A SMALL ENCLOSERE FOR CATTLE ,SHEEP ,POLUTRY ETC
PEN
MUSIC PLAYED OR SUNG AT NIGHT BELOW A PERSON’S WINDOW
SERENADE
STRONG AND SETTLED DISLIKE BETWEEN TWO PERSONS
ANTIPATHY
A SMALL HOUSE WITH ALL ROOMS ON ONE FLOOR
BUNAGLOW
AN EXTERMELY DEEP CRACK OR OPENING IN THE GROUND
CHASM
LOTTERY IN WHICH AN ARTICLE IS ASSIGNED BY LOT TO ONE OF THOSE BUYING TICKTS
RAFFLE /Draw
ONE WHO ALWAYS RUNS AWAY FROM DANGER
TIMID
ONE WHO DESPISES PERSONS OF LOWER SOCIAL POSITION
SNOB
GRADUAL RECOVERY FROM ILLNESS
CONVALESCENCE
ONE WHO IS DETERMINED TO EXACT FULL VEGEANCE FOR WRONG DONE TO HIM
VINDICTIVE
COMMENCEMENT OF WORDS WITH THE SAME LETTER
ALLITERATION
A PERSON LIVING PERMANENETLY IN A CERTAIN PLAC E
DOMICILE
TO SLAP WITH A FLAT OBJACT
SWAT
AN ASSEMBLY OF HEARAERS
ASSEMBLAGE
ONE WHO IS UNRELENTING AND CANNOT BE MOVED BY ENTREATIES
INEXORABLE
REGARD FOR OTHERS AS PRINCIPLE OF A ACTION
ALTRUISM
PERSON WHO CLAIMS TO HAVE GREAT LOVE FOR UNDERSTANDING OF WHAT IS BEAUTIFUL IN NATURE , ART ETC
AESTHETE
A DISEASE WHICH SPREADS BY CONTACT
CONTAGIOUS
AN ANIMAL STORY WITH MORAL
FABLE
PERSON WHO PIOLTS OR TRAVELS IN A BALLON AIRSHIP OR OTHER AIRCRAFT
AERONAUT
WITTY , CLEVER RETORT
REPARTEE
A STORY IN WHICH IDEAS ARE SYMBOLISED AS PEOPLE
ALLEGORY
A COMMON PLACE REMARK
PLATITUDE
A SUDDEN RUSH OF WIND
GUST
NOT CONFORMING TO ORDINARY RULES OF BEHAVIOUR
ECCENTRIC
SHORT DESCRIPATIVE POEM OR PICTURESQUE SCENE OR INCIDENT
IDYLL
A PERSON WHO IS RESEREVED IN TALKS
RETICENT
A SHORT STAY AT A PLACE
SOJOURN
A RAISED PLACE ON WHICH OFFERING TO A GOD ARE MADE
ALTAR
GOVERNMENT BY THE GODS
THERACHY
A PERSON WITH FULL DISCRETINARY POWER TO ACT ON BEHALF OF A COUNTRY
PLENIPOTENTIARY
TO DERIVE A THING OF ITS HOLY CHARACTER
DESCRATE
A SMALL PIECE OF WOOD
CHIP
A pioneer of a reform movement
Apostle
Wicked to a high degree
Heinous
The original inhabitants of a country
Aborigines
Dungeon entered by trapdoor
Oubliette
Science of printing
Typography
One who robs smuggler of his smuggled goods after the border has been crossed
Hijacker
Use of more words than are needed to express the meaning
Pleonasm
The science of judging of a person’s character capabilities etc. From an examination of the shape of his skull
Phrenology
A political leader who tries to stir up people
Demagogue
A light sailing boat built especially for racing
Yacht
Atonement for one’s sins
Repentance
Be the embodiment or perfect example
Personify
A person who maliciously destroys by fire
Incendiary
The line which a plough cuts in the ground
Furrow
A person who forsakes religion
Renegade
A person concerned with practical results and values
Pragmatist
Responsible according to law
Legitimate
Decision made upon a political question by the votes of all qualified persons
Plebiscite
Shining , brilliant and magnificent
Resplendent
Cutting for stone in the bladder
Lithotomy
A heavy unnatural slumber
Stupor
Changing one’s mind too quickly
Vacillation
To do away with rules
Abrogate
A person sharing responsibility for a political party’s discipline and tactics
Whip
Food which agrees with one’s taste
Palatable
A story in verse
Ballad
Plain or self evident truth
Truism
A person who has just started learning
Apprentice
A low area storm with high winds rotating about a centre of low atmospheric pressure
Cyclone
A fault that may be forgiven
Venial
One who is likeable
Amiable
Person who gives himself up to luxury and sexual pleasures
Voluptuary
A field or a part of a garden where fruit trees grow
Orchard
A women of lax moral
Harlot
A person who gives written testimony for use in a court
Deponent
A person who makes and sells ladies hats, etc.
Milliner
To mediate between two parties in a dispute
Intercede
The branch of science which deals with the problems of the old
Geriatrics
Property inherited from one’s father pr ancestors
Patrimony
Something left in a will by someone who has died
Legacy
The doctrine that human souls pass from one body to another at the time of death
Transmigration
A drawing on transparent paper
Transparency
The act of violating the sanctity of church
Sacrilege
A style in which a writer makes a display of his knowledge
Pedantic
One who thinks that human nature is essentially evil
Cynic
Interested mainly in a small group country etc.
Insular
The period between two reigns
Interregnum
Poem in short stanzas narrating a popular story
Ballad
One who does not know how to save the money
Spendthrift
Walk in a vain , self-important way
Strut
Clumsy or ill-bred fellow
Boor
A small shop that sells fashionable clothes, cosmetics etc.
Boutique
The normal abode of any animal or plant
Habitant
A person who is skilled in horsemanship
Equestrian
To atone one’s sins
Expiate
The rule of a person who is tyrant
Despotism
Of outstanding significance
Monumental
A tumour which is not likely to spared
Benign
To remove the skin of a potato or and orange
Peel
Explicit understanding to do something
Promise
To surround with armed forces
Besiege
A person who wishes to throw over all establishments
Anarchist
Forcing out(blood etc.) from its vessel
Extravasate
A book or picture produced merely to bring in money
Pot-boiler
Deviation or departure from common rule of standard
Anomaly
Elderly women in charge of a girl on social occasions
Chaperon
land so surrounded by water as to e almost and island
Peninsula
Part-song for several voices without instrumental accompaniment
Madrigal
A person without objective reality
Hallucination
Open rebellion of soldiers and sailors against lawful authority
Mutiny
A verse letter
Epistle
A person who travels from place to place
Itinerant
Something which can be taken for granted
Postulate
Words used in ancient time but no longer in general use now
Archaic
Cutting all the waste paper into pieces
Shredding
A solider who fights for money
mercenary
Government by all
Pant isocracy
Two wheeled cab for two to ride indie with driver mounted up behind
Hansom
Destroy without any trace
Obliterate
Submarines operate below the surface of the seas
Subterranean
Morning prayer in the church regularly
Matin
An unreal and visionary ideal
Chimerical
Give back to the users their youthful vigour and appearance
Rejuvenate
A lover of mankind
Altruist/philanthropist
An unconventional style of living
Bohemian
A person who is blindly devoted to an idea
Chauvinist
Suave (polished and light hearted person)
Debonair
A dabbler (not serious in art, Science and literature
Dilettante
That cannot be entered by force
Impregnable
A person who leads an immoral life
Libertine/Lecher
One hates the institution of marriage
Misogamist
One who eats everything
Omnivorous
One who works for the welfare of the women
Philogynist /Feminist
A boastful fellow
Swashbuckler
A noisy quarrelsome women, a shrew
Termagant
One who is habitual drunken
Toper/sot
One who is brilliant performer on stage(specially music)
Virtuoso
An annual calendar with position of stars
Almanac
A statement accepted as true without proof
Axiom
Examination of living tissue
Biopsy
Compulsory enlistment for military service
Conscription
An exact copy of handwriting ,printing
Facsimile/Xerox
Animals which live in a flock , used for human beings also
Gregarious/sociable
An act of separation from a person to avoid infection
Quarantine
Dress with medals, ribbons worn at official ceremonies
Regalia
A thing kept in memory of an event
Souvenir
A place where animals are slaughtered for the market
Abattoir
The dwelling place if an animal underground
Borrow
A place where treasurers ,stores ,ammunition are hidden
Cache
A graveyard where dead are buried
Crèche
An original glass bottle for holding wine or other alcoholic drinks
Decanter
A squirrel’s home
Drey
A home for old people
Infirmary
A place for wild animals and birds
Menagerie
A house or shelter for a dog
Kennel
A place where pigs are kept
Sty
A case in which the blade of a sword is kept
Sheath ,Scabbard
A place where lather is tanned
Tannery
One who drives a motor car
Chauffeur
One who introduces performing artists on the stage programmes
Compere
One who studies the pattern of voting in elections
Psephologist
Government by old man
Gerontocracy
Government by the worst citizen
Kekistocracy
Government run universally
Panarcy
A funeral procession comprising a number of mourners
Cortege
Murder of one’s children
Filicide
Murder of one’s brother
Fratricide
Murder of one’s parents
Parricide
Murder of one’s sister
Sororicide
Live in relationship a man and a woman living without being married
Concubiange
Happening in five years
Quinquennial
150th anniversary
Sesquicentennial
A collection of poem
Anthology
A large number of cotton tied in a bundle
Bale
A large group of girls/ladies
Bevy
A pair of pigeons
Brace
Of inner circle of members of government
Caucus
A small person belonging to a body
Clique
A group[p of applauders i.e. paid to clap
Claque
A group of islands
Cluster
A group of worshipers
Congregation
A small fleet of boats
Flotilla
A number of fish caught (in net) caught at one time
Haul
A number of ruins, stones
Heap
Of young pigs, dogs at birth
Litter
A group of people who are the same in some way
Posse
A section of hair
Lock
A large number of fish swimming together
Shoal
A sequence of similar items
String
A flies or locusts, bees ,ants
Swarm
A framework of rafters, posts and bars
Truss
A large crowd of people
Throng
A group of dancers, artists or acrobats
Troupe
Of abusive invectives
Torrent
Of grass ,hair
Tuft
In questions
Barrage
The study of sounds
Acoustics
The science of soil management and the production of field crops
Agronomy
Chemistry in ancient times
Alchemy
Cultivation of tress and vegetables
Arboriculture
The study of duration of life
Chronology
The art of making fireworks
Chromatics
The study of cells, especially their formation structure and functions
Cytology
The study of finger prints for the purpose of identification
Dactylographic
The study of animal behaviour
Ethology
The study of production of better offspring by the careful selection of parents
Eugenics
The study of effect of environment on workers
Ergonomy
The sun therapy
Heliotherapy
The study of tissues
Histology
The study of teeth
Odontology
The study of correct pronunciation
Orthoepy
The art of method of teaching
Pedagogy
The study of rocks
Petrology
The study of written records their authenticity etc.
Philology
The study of speech sounds and production, transmission , reception
Phonetics
The study of human face
Physiognomy
The study of ancient writing
Palaeography
The art of elegant speech or writing
Rhetoric
The study of caves
Spelelogy
An admirer of art
Dilettante
Use of mild word in place of words required by truth
Euphemism
That which is pig like
Porcine
That is fox like
Vulpine
Study of law
Nomo logy
Study of fossils
Palaeontology
Statement that is obviously true
Platitude
Temple dedicated to all the gods
Pantheon
The study of physical phenomenon of lakes
Limnology
Serious crime like murder ,arson
Felony
Secret place difficult to reach
Recess
Secret religious meeting
Conventicle
Showing contemptuous indifference
Supercilious
A short summary of a book or speech
Epitome
A short saying or poem which express an idea in a very clever and amusing way
Epigram
Scornful and contemptuous language
Opprobrium
Science of time
Horology
Science of the races of mankind and their relation to one another
Ethnology
Science of the causes of diseases
Etiology/aetiology
Science of human beauty
Kalology
Science and philosophy of human law
Jurisprudence
To raise a pattern or design on the surface of something
Emboss
Quick to judge and understand
Perspicacious
Pull out of usual shape
Distort
Public marry making and feasting
Carnival
Prevent from being carried out
Circumvent
Present from or before birth
Congenital
Lover of dogs
Canophilist
Guided by one’s sense of duty
Conscientious
Gust of wing
Draught
Offering made to god
Oblation
Gathering of all things
Omnibus
A garland of flowers
Wreath
Give the right to vote
Enfranchise
Future generation
Posterity
Fit for bad temper or anger
Tantrum
Blessing given by priest
Benediction
Bring under control in war
Subjugate
That can live without outside help
Viable
Angry at injustice
Indignant
Change to something abnormal , unnatural
Perversion
Habitual character and deposition
Ethos
To destroy
Annihilate
Recurrence of some disease after generation or similarity in special features with remote ancestors
Atavism
To mitigate of lessen the suffering or pain
Alleviate
To make better , to improve or to lift or a better place
Ameliorate
A mistake in the chronological order or a thing which is out of harmony with a period
Anachronism
Any language speaking only
Colloquialism
A person who fails in the performance of this duty or commits and offence
Delinquent
Something regularly found among a particular people or community
Endemic
A professor who has retired from service
Emeritus
To free from the confines of something to liberate from
Emancipate
Something artificial having the appearance of some thing got up
Factitious
As opposed to realistic , imagined not real
Fictitious
Tendency to grow downwards
Geotropism
A personal peculiarity of temperament or constitution
Idiosyncrasy
A person who has a most uncompromising attitude especially on politics
Intransigent
A subtle allusive and generally deprecatory remark
Innuendo
Extremely extravagant in manners and morals
Licentious
Belonging to this word , earthly
Mundane
Application of name or descriptive term to an object to which it is not literally applicable
Metaphor
A scene or situation which is gruesomely imaginative or full of gruesome details
Macabre
A change that befalls something
Mutation
A drama which is marked by very crude appeal to feelings and emotions
Melodrama
One who believes in the philosophy that nothing has real existence
Nihilist
A quick remedy or apparent medicine or similarly a pet scheme
Nostrum
The art of spelling words correctly
Orthography
A passage marking the close of speech
Peroration
A school teacher or a man affecting learning
Pedagogue
Original modal
Prototype
To mediate, to pander over a question
Ruminate
A person who refuses compliance with
Recalcitrant
A reasoned willing to avail himself of fallacies that will help his case
Sophist
A very delicate flaw or mistake which is not expected from the person making it
Solecism
A symbolic religious ceremony especially baptism
Sacrament
Abounding in blood
Sanguine
Affectedly and pompously formal person or style
Sententious
That which surpasses
Transcendental
The practise of taking exorbitant or excessive interest on the money lent
Usury
Guilty of accepting bribes extremely mercenary
Venal
A person sent on a mission
Emissary
Not definitely or clearly expressed
Inexplicit
Incapable of being taken by force or arms
Impregnable
To increase the gravity of an offence or the intensity of a dispute
Aggravate
A man or woman with skin and hair or auburn colour
Blonde
Wilful and persistent resistance to lawful authority
Contumacy
A person who is insensible to kind thoughts or sympathetic feeling
Callous
Total loss of voice
Aphonia
To do away with a rule
Abrogate
To make thin or fine or to reduce the strength
Attenuate
Deviation from eh common rule of standard
Anomaly
Stealthy done
Surreptitious
Mental derangement
Paranoia
Wild and noisy disorder
Pandemonium
Placing a thing beside another
Juxtapose
The abandonment of one’s country or cause
Desertion
Bitter and violent attack in words
Diatribe
The state of being miserable , bereft of all possessions
Destitute
Commencement of adjacent words with the same letter
Alliteration
A wall built to prevent the sea or a river from flooding an area
Embankment
Something that is poisonous or unhealthy
Trivial
A small umbrella
Parasol
To have a very high opinion of oneself
Conceited
The highest singing voice in women or boys or a music in highest voice
Soprano
A song to put babies to sleep
Lullaby
The original inhabitants of a country
Aborigines
Winding sheet of a corpse
Shroud
Bearing young’s by eggs
Oviparous
Bearing living young’s
Viviparous
Fond of much alcoholic drinks
Bibulous
A hater of new things
Misoneist
Hatter of smoking
Misocapnic
A lover of animals
Philozoic
A lover of learning
Philomath
A lover of poetry and art
Philomuse
That which is not composed of matter
Incorporeal
One who always gets into trouble
Scapegrace
Persuade by flattery
Cajole
That which has very harmful and dangerous effects
Detrimental
That which is corpse like
Cadaverous
That is cat like
Feline
A vehicle that is used to carry a dead body
Hearse
A person who is very cruel
Fiend
Swelling part of a body
Inflammation
The dad body of a animal
Carcase
A medicine which induces vomit
Emetic
A spear on a rope for catching whales and other larger fish
Harpoon
A female of gander
Goose
An adult male of deer
Hart
A word that is the same in sound as another but different in meaning
Homonym
Words alike in sound but different in meaning and spelling
Paronym
A dog used for hunting
Hound
A magnificent tomb
Mausoleum
An impudent girl
Minx
Flesh of sheep used as food
Mutton
Secretion of a plant which attracts the insects or birds that pollinate flowers
Nectar
A member of a wandering tribe
Nomad
A person who looks after horses in a inn
Ostler
A set of instruments put together for a purpose
Apparatus
An area planted with grapes
Vineyard
A disease that is found regularly in a particular place
Endemic
A disease widely epidemic
Pandemic
That which can not be burnt
Incombustible
A person who is very careful in the use of money
Frugal/parsimonious
Able to walk after being bedridden
Ambulatory
Absolute right
Prerogative
Accept without protest or silently
Acquiesce
Being economical in speech or expressed in few words
Laconic
Belief accepted without question
Dogma
Branches of learning concerned with literature history
Humanities
and philosophy
Bring under control especially a group of people causing trouble
Subdue
Calmness of mind and temper
Equanimity
Ceremony of crowning a king
Coronation
Chain of flowers ,leaves ribbons etc.
Festoon
Collection of flowers
Anthology
Compel to a course of action
Coerce
Compensation of loss
Indemnity
Complain or protest irritatingly
Grudge /grumble
Concluding part of speech
Peroration
Confused and disorderly
Promiscuous
Conference for discussion on a subject
Symposium
Confused struggle or fight
Scrimmage
Copy or reproduction of a work
Replica
Craze for flowers
Anthomania
Cud-chewing animal
Ruminant
Cut into small peaces
Mince
Cutting or arm, leg, etc. By surgery
Amputation
Cutting and gathering of grain
Harvest
Difficult or dangerous situation
Predicament
Done or obtained without payment or free of charge
Gratuitous
Easily bending
Supple
Equally sensitive to all colours
Panchromatic
Express earnest disapproval of
Deprecate
Expand and contract rhythmically
Pulsate
Fastest speed of a horse
Gallop
Felling of fear and disappointment
Dismay
Feeling or impression that something evil is going to happen
Presentment
Feeling that everything turns
Giddiness
Fixed sum of money paid to somebody as income in his lifetime
Annuity
Fond of new things
Newfangled
Foolish love
Infatuation
Forecast of the probable course of a disease or illness
Prognosis
Gay and elegant dress or appearance
Finery
Give more force or importance to
Accentuate
Give something as a security for debt
Pawn/mortgage
Having a common terminus or boundary
Coterminous
Having a full , deep sound
Sonorous
Having a similar nature, common interest
Congenial
Having a vague desire
Wistful
Having the same source or origin
Cognate
Hiding of true feelings
Dissimulation
In a primitive or uncivilized state
Savage
Incur loss through some fault
Forfeit
Identical in all respects
Congruent
Indirect effect or remote effect of some event
Repercussion
Instrument for measuring the intensity of light
Photometer
Interrupt and ask troublesome questions
Heckle
Interrupt the proceeding and demand a statement or explanation from
Interrelate
Judicial process or order to stop something
Injunction
Killing of one’s husband
Mariticide
Lacking in sexual power or sufficient strength to do something
Impotent
Loss of ability to use speech/understand
Aphasia
Make a deep sound of pain
Groan
Make desolate
Devastate
Make (something misleading) additions to a book
Interpolate
Military forces and their equipments
Armament
Miscellaneous articles not listed separately
Sundries
Money in form of coins
Specie
Name derived from father’s name
Patronymic
Natural tendency to do something
Propensity
Noisy drinking party or merry making
Carousal
Not shoeing proper respect
Impertinent
Occurring here and there or now and then of or for all
Sporadic
Of the daytime
Diurnal
Of all sorts
Omnifarious
One preying on or exploiting others
Predator
One who arranges for the supply of food in a club, school etc.
Steward
One who courts or woos a woman
Suitor
One who explains a theory , idea etc.
Exponent
One who habitually relapses into crime or one who cannot be cured of criminal activities
Recidivist
One who has no means of live hood
Pauper
One who makes an eloquent public speech
Orator
One who spends one’s money recklessly
Spendthrift/Prodigal
One who sells fruit, vegetables etc. From a barrow in the streets
Grocer
One who shows lack of respect or religious reverence
Impious
Page number of a book
Folio
Pardon or forgiveness of sins by god
Remission
Particular point of good conduct , ceremony honour
Punctilio
Period of rest or sleep taken in the early afternoon
Siesta
Person singing jointly with others
Cosignatory
Person to whom another gives encouragement and help
Protégé
Person who changes his religious belief
Renegate/ Renegade
Personal belonging , equipments etc.
Paraphernalia
Place for ideal peace and happiness
Elysium
Place for public speaking
Rostrum
Plead to obtain a favour
Intercede
Pleasant or sharp to the taste
Piquant
Practise of using abuse
Scurrility
Presented in a forceful and convening manner
Cogent
Principal raw material or commodity grown in a locality
Staple
Put under the surface of water
Submerge
Scatter things among others or place here and there
Intersperse
Severe test of character or endurance
Ordeal
Short saying expressing a general truth
Maxim/proverb/dictum/adage
Smash to pieces
Shatter
Something that is detested
Anathema
Something which religion or custom regards as forbidden
Taboo
State of unconscious
Narcosis
Sticking together
Coherent
Story told to illustrate a moral or spiritual truth
Didactic
Stroke of good luck
Fluke
Study of literature dealing with lives of saints
Hagiology
Style in which a writer makes a display of his knowledge
Ornate
Substance used in place of sugar
Saccharin
Suffering from bodily or mental weakness because old age
Senile
Suggest in addition to the fundamental meaning
Connote
Suggest indirectly
Insinuate
Suggesting absence of thought or intellect
vacuous
System of religious worship
Cult
That cannot be erased or removed
Indelible
That cannot be weighed
Imponderable
That easily changes into gas or vapour
Volatile
That which can lessen the severity of (pain , disease)
Palliative
That which cannot be doubted or questioned
Unimpeachable
That which eats grass
Herbivore /herbivorous
Thing to be added at the end of a book etc.
Addendum
Theory of utility
Pragmatism
Turn or wander away from the main topic
Digress
Union of states, parties, or persons
Confederacy
Use in an unworthy or wicked way
Desecrate /defile
Use of public money for one’s own benefit
Peculation/embezzlement
Way out for water or stream
Outlet
Whole body of wage earners
Proletariat
Wide spread violence
Havoc
Witty clever retort
Repartee
Word formed from initial letters of a name
Acronym
Word made by changing the order of the letters in another word
Anagram
Woven fabric richly ornamented with designs
Brocade
Written law passed by the law making body
Statute
Of a very short duration of period
Transient
Not clearly expressed or understand
Inscrutable
Area of land almost surrounded by sea
Peninsula
Salt water lake separated from the sea by sand banks
Lagoon
Person who caters to the rich
Sycophant
One who doubts the soundness of inferences
Aesthetic
An expression of mild disapproval
Denigration
Art of poetry
Ceramics
Extreme old age when a man behaves like a fool
Dotage

What the Web browser do?

You already know how a browser works: you’re surfing around the Web and you click on a link
to visit a page. That click causes your browser to request an HTML page from a Web server,
retrieve it, and display the page in your browser window.

What does the Web server do?

Web servers have a full time job on the Internet, tirelessly waiting for requests from Web
browsers. What kinds of requests? Requests for Web pages, images, sounds, or maybe even a
movie. When a server gets a request for any of these resources, the server finds the resource,
and then sends it back to the browser

The server’s just a computer
connected to the Internet waiting
for requests from browsers.

Friday, November 20, 2015

What is the cloud?

You hear a lot about ‘the cloud’, but how does it actually work?

The term ‘cloud’ implies something that’s above your head, but in reality the data
that you upload is likely to be stored very much at ground level or even underground,
and probably thousands of miles away from your location. A cloud service is actually a cluster
of computers: more accurately, a huge number of servers with vast amounts of hard drive
storage attached. It’s a natural evolution of the technology behind the internet itself and
has come about largely thanks to rapid improvements in global bandwidth and the
plummeting price of storage capacity. The internet is actually just a collection of data
centres – albeit many thousands – all connected through various global hubs and thousands of
miles of heavy-duty undersea cabling. As the web grew and companies like Microsoft, Apple,
Google and Amazon came to use it more and more for services, sales and software delivery, it
became necessary to build large server farms and data centres to cope with the sheer volume
of visitors and information they had to store and serve to users. Companies like Akamai grew
correspondingly, providing heavyweight video streaming and content delivery for
other big tech companies. Bandwidth isn’t free, and big telecoms firms. round the world own the physical infrastructure and charge your ISP for it. The idea that ordinary users could use cloud
storage began to take off as home broadband started to become widely available. Companies
would offer online file storage, but for a long time capacities were low and prices high. Apple’s
own early forays into the world of cloud storage were not entirely blemish-free, with iTools and
later .Mac and MobileMe failing to live up to the company’s reputation for ease of use. With
iCloud, that early vision has been much more fully realised. At the same time many other developers
(Dropbox, Microsoft, Google, Amazon and Box, to name just a few) built their own cloud syncing
and sharing services that usually work across Macs, PCs, iOS devices and often Android.
Though Apple and Microsoft have an interest in making their cloud services integrate specifically
with their own operating systems and hardware, third party developers want to be on all the big
platforms, which is great news for users because


Why does my MacBook overheat?

Why does my MacBook overheat?

If the air coming out of the vent feels cool, this might be a problem with the fan regulator rather than overheating. If your Mac  isn’t running hot during video playback then it  isn’t likely to suddenly heat up just because you’ve closed the video. OS X  doesn’t run the fan slower than it needs to. It is, however, common for fans to get stuck at maximum speed; it’s nearly  always fixed by resetting the System Management Controller (SMC). On the 2007 MacBook Pro, which has a removable  battery, the procedure is to shut down the Mac, disconnect the MagSafe connector, take out the battery and hold the power  button down for five seconds. Then put the battery and MagSafe connector back in and restart.

Thursday, November 19, 2015

Hack WI FI network using android

There is no need to hack any wifi with rooting your Android,you have to just follow few steps for hack wifi,  It used to be that you needed a desktop OS such as Windows or Linux installed on a computer with a specific wireless network card. Now, however, you can also use certain Android devices to scan and crack wifi. 
You need a software ,named as  WPSPIN
STEP 1 : Download an app called WPSPIN from here.

Saturday, November 14, 2015

Swings chapter 15

Chapter 15

Swing Basics

There are two technologies you use when developing desktop user-interface: the Abstract Window Toolkit (AWT) and Swing. You may have heard that the AWT is an old technology—having been in existence since Java 1.0—that has been replaced by Swing. It is true, but it's not time yet to toss the AWT.

Swing is preferred because it has a better collection of ready-to-use components. Swing components are also much more powerful than their AWT counterparts. For one, some Swing components can render HTML tags, something AWT developers would not even dare to dream about. Nonetheless, the AWT is still relevant because Swing relies on the AWT event handling mechanism and layout managers as well as its various classes; therefore you still need to know about those classes. Moreover, when developing applets (See Chapter 20, “Applets”), your knowledge of AWT will come handy in too.

Note

Swing is part of the Java Foundation Classes (JFC), a collection of features for building graphical user interfaces (GUIs) and adding interactivity to Java applications. The JFC was launched at the 1997 JavaOne conference and includes the following technologies: the Java 2D API, Drag-and-Drop support, internationalization, pluggable Look-and-Feel support, and the Accessibility API.



There are three things you need to learn to become an effective UI programmers:

images UI components. These include top-level containers (JFrame, JDialog, etc) and components that can be added to a container.

images Layout managers. How to lay out your components in a container.

images Event handling. How to write code that responds to an event, such as a button click, a mouse move, a window resize, etc.



This chapter starts with AWT components, which will be only briefly discussed. Following it are sections on simple Swing components, such as JFrame, JButton, JLabel, JTextArea, JOptionPane, and JDialog. Chapter 16, “Swinging Higher” focuses on layout management and event handling. In addition, there is discussion of thread-related Swing classes in Chapter 23, “Java Threads” and Chapter 24, “The Concurrency Utilities.”

Note

The main difference between AWT and Swing lies in how they draw graphic components. AWT calls the native GUI functions of the operating system to do that. This means, programs that use AWT will look different on Windows and on Unix. The term ‘peer’ is often used when describing this approach. When you invoke an AWT method to draw a button, AWT will in turn delegate the task to a ‘peer’ native function. However, writing high-quality drawing methods that rely on native functions proves to be difficult because the native operating system does not always have a necessary function that can be used to perform certain functionality. As a result, Sun Microsystems invented Swing. Swing draws all its UI components itself, hence eliminating dependence on native peers. With Swing, a GUI program will look the same everywhere, be in on Linux, Mac, or Windows. (In practice, this is not really true.) In older machines, the side-effect of having to draw everything itself is that Swing programs look a little sluggish, because of course it takes more time than if the same graphics were displayed using native functions. However, with today's computers, it is no longer a problem.

AWT Components

AWT components are grouped into the java.awt package. At its core is the Component class, which is a direct subclass of java.lang.Object. This is described in Figure 15.1.

images

Figure 15.1: AWT components

The Component class has subclasses that represent components that you can draw on your UI program:

images  Button. Represents a clickable button.

images  Canvas. Represents a blank screen you can draw custom paintings on.

images  Checkbox. Represents a check box.

images  Choice. Represents a radio button.

images  Container. Represents a component that can contain other components.

images  Label. Represents a non-editable piece of text.

images  List. Represents a list of options.

images  Scrollbar. Represents horizontal and vertical scrollbars.

images  TextComponent. A parent class of two concrete classes: TextArea and TextField. TextField can contain a single line of text and TextArea multiple lines of text.



Of special interest is the Container class. You can add components to a Container using one of its add methods. A concrete implementation of Container is Window, which is the parent of the Frame class. Even though you can instantiate Window, more often you will use a Frame or Dialog to contain other components because Frame and Dialog are easier to use and have more features than Window. Frame and Dialog are similar, except for the fact that Dialog is often used to take user input. Almost all AWT applications will have at least one Frame.

The Frame class offers the following methods:

images  setTitle. Sets the frame's title.

images  add. Adds an AWT component on to the frame.

images  remove. Removes an AWT component from the frame.

images  show. Displays this Frame.



In a typical AWT application, you normally start your program by constructing an instance of Frame and adding components to it. Listing 15.1 features the AWTFrameTest class that adds various AWT components to a Frame.

Listing 15.1: Using AWT components


package app15;
import java.awt.Button;
import java.awt.Checkbox;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.Label;
import java.awt.TextField;

public class AWTFrameTest extends Frame {
    public static void main(String[] args) {
        AWTFrameTest frame = new AWTFrameTest();
        frame.setTitle("My AWT Frame");
        frame.setSize(300, 100);
        frame.setLayout(new FlowLayout());
        // add components
        Label label = new Label("Name");
        frame.add(label);
        TextField textField = new TextField();
        frame.add(textField);
        Button button = new Button("Register");
        frame.add(button);
        Checkbox checkbox = new Checkbox();
        frame.add(checkbox);
        frame.setVisible(true);
    }
}

The AWTFrameTest class extends java.awt.Frame. After you create a Frame, you can call its setTitle method and pass a String for its title. You can also invoke the setSize method to set the frame's width and height in pixels.

The line in bold in Listing 15.1 is a call to the setLayout method. You pass a LayoutManager to this method and the object will determine how child components added to a frame are laid out. We will discuss LayoutManager further in Chapter 16, “Swinging Higher.”

You can add components to a frame by using the add method of the Frame class. In Listing 15.1, we added four components, a Label, a TextField, a Checkbox, and a Button. Finally, the setVisible method is invoked to make the frame visible.

If you run the AWTFrameTest class, you will see something like Figure 15.2. Its actual appearance depends on the operating system the program is running on.


Figure 15.2: An AWT Frame and some components

The frame in Figure 15.2 has a size of 300 by 100 pixels. Its title says “My AWT Frame.” There are four components added to it.

Note

The close button (indicated by X) does not close the frame. In fact, making an AWT frame closable by a single click is not straight-forward. This has been remedied in Swing, which is one of the reasons Swing is better and easier to program.



The GUI application in Figure 15.2 looks good enough for introduction, but you can do more with the AWT library. You can add menus and submenus, write code that responds to an event (such as a button click or window resize), use a layout manager to lay out components, and so on. We will not delve into AWT components deeper because we want to focus on Swing.

Useful AWT Classes

In addition to AWT classes that are parents to Swing components, there are other classes that are often used in Swing applications. These classes are discussed in this section.

java.awt.Color

A Color represents a color. Creating a Color object is supereasy because the Color class provides static fields that return a specific Color. The names of these fields are the same as the colors they represent. Here are some of the static final fields in Color: BLACK, BLUE, GREEN, RED, CYAN, ORANGE, YELLOW.

For example, here is how you obtain a green Color:

Color color = Color.GREEN;

You can also create a custom color by passing red-green-blue (RGB) values to the Color class's constructor. For example:

Color myColor = new Color(246, 27, 27);

To change a component's color, call the setForeGround and setBackGround methods of the component.


component.setForeGround(Color.YELLOW) ;
component.setBackGround(Color.RED);

java.awt.Font

A Font represents a font. Here is a constructor of the Font class.

public Font(java.lang.String name, int style, int size)

Here, name is the font name (such as “Verdana”, “Arial”, etc) and size is the point size of the font. The style argument takes an integer bitmask that may be PLAIN or a bitwise union of BOLD and/or ITALIC.

For example, the following code construct a Font object.

int style = Font.BOLD | Font.ITALIC;
Font font = new Font("Garamond", style , 11);

java.awt.Point

A Point represents a point in a coordinate system. It has two int fields, x and y. You can construct a Point object by using one of its constructors.


public Point()

public Point(int x, int y)

public Point(Point anotherPoint)

The Point class's getX and getY methods return the value of the x and y fields in double, respectively.

java.awt.Dimension

A Dimension represents a width and a height in int. It is meant to represent the dimension of an AWT or Swing component. There are two int fields, width and height. The getWidth and getHeight methods return a double, not an int. You can construct an instance of Dimension by using one of its constructors:


public Dimension()

public Dimension(Dimension d)

public Dimension(int width, int height)

The no-arg constructor creates a Dimension with a zero width and height.

java.awt.Rectangle

A Rectange specifies a rectangular area in the coordinate system. Its x and y fields specify the top-left corner coordinate. Its width and height fields specify the width and height of the rectangle, respectively.

Here are some of the constructors of Rectangle.


public Rectangle()

public Rectangle(Dimension d)

public Rectangle(int width, int height)

public Rectangle(int x, int y, int width, int height)

java.awt.Graphics

The Graphics class is an abstract class for rendering AWT and Swing components. You need to work with a Graphics if you want to change the appearance of a component, create a custom component, and so on. To do this, you override the component's paint method:

public void paint(Graphics graphics)

The overridden method takes a Graphics that you can use to paint your component. After you obtain a Graphics, you can call its various methods to draw on it. Here are some of the methods in Graphics: drawArc, drawChars, drawImage, drawLine, drawOval, drawPolygon, drawPolyline, drawRect, drawString, fillArc, fillOval, etc.

java.awt.Toolkit

The Toolkit abstract class has the following methods that make it interesting.

public static Toolkit getDefaultToolkit()

Returns the default implementation of the Toolkit class.

public abstract void beep()

Produces a beep sound.

public abstract Dimension getScreenSize()

Returns a java.awt.Dimension object containing the width and the height of the screen.

Basic Swing Components

Swing is the Java technology for developing desktop applications that need graphical user interface (GUI), replacing AWT but still using the AWT event model. As a technology, Swing is mature and complete, its rich set of classes and interfaces spanning across 17 packages. Swing components are contained in the javax.swing package. Figure 15.3 depicts the class hierarchy of Swing components. To save space, all classes with no package name belong to the javax.swing package.


Nested and Inner Classes Chapter 14

Chapter 14

Nested and Inner Classes

Nested and inner classes are often considered too confusing for beginners. However, they have some merits that make them a proper discussion topic in this book. To name a few, you can hide an implementation completely using a nested class, and it provides a shorter way of writing an event-listener.

One of the reasons nested and inner classes sometimes seem overly complex is because the terms “nested classes” and “inner classes” are often used to mean different things in different texts. This book will stick to the definitions in The Java Language Specification, Third Edition, which is the formal specification from Sun Microsystems (http://java.sun.com/docs/books/jls/).

This chapter starts by defining what nested classes and inner classes are and continues by explaining types of nested classes.

An Overview of Nested Classes

Let's start this chapter by learning the correct definitions of nested and inner classes. A nested class is a class declared within the body of another class or interface. There are two types of nested classes: static inner classes and non-static nested classes. Non-static nested classes are called inner classes.

There are several types of inner classes:

images member inner classes

images local inner classes

images anonymous inner classes

The term “top level class” is used to refer to a class that is not defined within another class or interface. In other words, there is no class enclosing a top level class.

A nested class behaves pretty much like an ordinary (top level) class. A nested class can extend another class, implements interfaces, become the parent class of subclasses, etc. Here is an example of a simple nested class called Nested that is defined within a top level class named Outer.


public class Outer {
    class Nested {
    }
}

And, though uncommon, it is not impossible to have a nested class inside another nested class, such as this:


public class Outer {
    class Nested {
        class Nested2 {
        }
    }
}

To a top-level class, a nested class is just like other class members, such as methods and fields. For example, a nested class can have one of the four access modifiers: private, protected, default (package), and public. This is unlike a top level class that can only have either public or default.

Because nested classes are members of an enclosing class, the behavior of static nested classes and the behavior of inner classes are not exactly the same. Here are some differences.

images Static nested classes can have static members, inner classes cannot.

images Just like instance methods, inner classes can access static and non-static members of the outer class, including its private members. Static nested classes can only access the static members of the outer class.

images You can create an instance of a static nested class without first creating an instance of its outer class. By contrast, you must first create an instance of the outer class enclosing an inner class before instantiating the inner class itself.



These are the benefits of inner classes:

1. Inner classes can have access to all (including private) members of the enclosing classes.

2. Inner classes help you hide the implementation of a class completely.

2. Inner classes provides a shorter way of writing listeners in Swing and other event-based applications.



Now, let's review each type of static class.

Static Nested Classes

A static nested class can be created without creating an instance of the outer class. Listing 14.1 shows this.

Listing 14.1: A Static Nested Class


package app14;
class Outer1 {
    private static int value = 9;
    static class Nested1 {
        int calculate() {
            return value;
        }
    }
}

public class StaticNestedTest1 {
    upblic static void main(String[] args) {
        Outer1.Nested1 nested = new Outer1.Nested1();
        System.out.println(nested.calculate());
     }
}

There are a few things to note about static nested classes:

images You refer to a nested class by using this format:

OuterClassName.InnerClassName

images You do not need to create an instance of the enclosing class to instantiate a static nested class.

images You have access to the outer class static members from inside your static nested class



In addition, if you declare a member in a nested class that has the same name as a member in the enclosing class, the former will shadow the latter. However, you can always reference the member in the enclosing class by using this format.

OuterClassName.memberName

Note that this will still work although memberName is private. Examine the example in Listing 14.2.

Listing 14.2: Shadowing an outer class's member.


package app14;
class Outer2 {
    private static int value = 9;
    static class Nested2 {
        int value = 10;
        int calculate() {
            return value;
        }
        int getOuterValue() {
            return Outer2.value;
        }
    }
}

public class StaticNestedTest2 {
    public static void main(String[] args) {
        Outer2.Nested2 nested = new Outer2.Nested2();
        System.out.println(nested.calculate()); // returns 10
        System.out.println(nested.getOuterValue()); // returns 9
    }
}

Member Inner Classes

A member inner class is a class whose definition is directly enclosed by another class or interface declaration. An instance of a member inner class can be created only if you have a reference to an instance of its outer class. To create an instance of an inner class from within the enclosing class, you call the inner class's constructor, just as you would other ordinary classes. However, to create an instance of an inner class from outside the enclosing class, you use the following syntax:


EnclosingClassName.InnerClassName inner =
        enclosingClassObjectReference.new InnerClassName();

As usual, from within an inner class, you can use the keyword this to reference the current instance (the inner class's instance). To reference the enclosing class's instance you use this syntax.

EnclosingClassName.this

Listing 14.3 shows how you can create an instance of an inner class.

Listing 14.3: A member inner class


package app14;
class TopLevel {
    private int value = 9;
    class Inner {
        int calculate() {
            return value;
        }
    }
}

public class MemberInnerTest1 {
    public static void main(String[] args) {
        TopLevel topLevel = new TopLevel ();
        TopLevel.Inner inner = topLevel.new Inner();
        System.out.println(inner.calculate());
    }
}

Notice how you created an instance of the inner class in Listing 14.3?

A member inner class can be used to hide an implementation completely, something you cannot do without employing an inner class. The following example shows how you can use a member class to hide an implementation completely.

Listing 14.4: Hiding implementations completely


package app14;
interface Printer {
    void print(String message);
}
class PrinterImpl implements Printer {
    public void print(String message) {
        System.out.println(message);
    }
}
class SecretPrinterImpl {
    private class Inner implements Printer {
        public void print(String message) {
            System.out.println("Inner:" + message);
        }
    }
    public Printer getPrinter() {
        return new Inner();
    }
}
public class MemberInnerTest2 {
    public static void main(String[] args) {
        Printer printer = new PrinterImpl();
        printer.print("oh");
        // downcast to PrinterImpl
        PrinterImpl impl = (PrinterImpl) printer;

        Printer hiddenPrinter =
                (new SecretPrinterImpl()).getPrinter();
        hiddenPrinter.print("oh");
        // cannot downcast hiddenPrinter to Outer.Inner
        // because Inner is private
    }
}

The Printer interface in Listing 14.4 has two implementations. The first is the PrinterImpl class, which is a normal class. It implements the print method as a public method. The second implementation can be found in SecretPrinterImpl. However, rather than implementing the Printer interface, the SecretPrinterImpl defines a private class called Inner, which implements Printer. The getPrinter method of SecretPrinterImpl returns an instance of Inner.

What's the difference between PrinterImpl and SecretPrinterImpl? You can see this from the main method in the test class:


Printer printer = new PrinterImpl();
printer.print("Hiding implementation");
// downcast to PrinterImpl
PrinterImpl impl = (PrinterImpl) printer;

Printer hiddenPrinter = (new SecretPrinterImpl()).getPrinter();
hiddenPrinter.print("Hiding implementation");
// cannot downcast hiddenPrinter to Outer.Inner
// because Inner is private

You assign printer an instance of PrinterImpl, and you can downcast printer back to PrinterImpl. In the second instance, you assign Printer with an instance of Inner by calling the getPrinter method on SecretPrinterImpl. However, there is no way you can downcast hiddenPrinter back to SecretPrinterImpl.Inner because Inner is private and therefore not visible.

Local Inner Classes

A local inner class, or local class for short, is an inner class that by definition is not a member class of any other class (because its declaration is not directly within the declaration of the outer class). Local classes have a name, as opposed to anonymous classes that do not.

A local class can be declared inside any block of code, and its scope is within the block. For example, you can declare a local class within a method, an if block, a while block, and so on. You want to write a local class if an instance of the class is only used within the scope. For example, Listing 14.5 shows an example of a local class.

Listing 14.5: Local inner class


package app14;
import java.util.Date;

interface Logger {
    public void log(String message);
}
public class LocalClassTest1 {
    String appStartTime = (new Date()).toString();
    public Logger getLogger() {
        class LoggerImpl implements Logger {
            public void log(String message) {
                System.out.println(appStartTime + " : " + message);
            }
        }
        return new LoggerImpl();
    }

    public static void main(String[] args) {
        LocalClassTest1 test = new LocalClassTest1();
        Logger logger = test.getLogger();
        logger.log("Local class example");
    }
}

The class in Listing 14.5 has a local class named LoggerImpl that resides inside a getLogger method. The getLogger method must return an implementation of the Logger interface and this implementation will not be used anywhere else. Therefore, it is a good idea to make an implementation that is local to getLogger. Note also that the log method within the local class has access to the instance field appStartTime of the outer class.

However, there is more. Not only does a local class have access to the members of its outer class, it also has access to the local variables. However, you can only access final local variables. The compiler will generate a compile error if you try to access a local variable that is not final.

Listing 14.6 modifies the code in Listing 14.5. The getLogger method in Listing 14.6 allows you to pass a String that will become the prefix of each line logged.

Listing 14.6: PrefixLogger test


package app14;
import java.util.Date;

interface PrefixLogger {
    public void log(String message);
}

public class LocalClassTest2 {
    public PrefixLogger getLogger(final String prefix) {
        class LoggerImpl implements PrefixLogger {
            public void log(String message) {
                System.out.println(prefix + " : " + message);
            }
        }
        return new LoggerImpl();
    }

    public static void main(String[] args) {
        LocalClassTest2 test = new LocalClassTest2();
        PrefixLogger logger = test.getLogger("DEBUG");
        logger.log("Local class example");
    }
}

Anonymous Inner Classes

An anonymous inner class does not have a name. A use of this type of nested class is for writing an interface implementation. For example, the AnonymousInnerClassTest class in Listing 14.7 creates an anonymous inner class which is an implementation of Printable.

Listing 14.7: Using an anonymous inner class


interface Printable {
    void print(String message);
}

public class AnonymousInnerClassTest 1{
    public static void main(String[] args) {

        Printable printer = new Printable() {
            public void print(String message) {
                System.out.println(message);
            }
        }; // this is a semicolon

        printer.print("Beach Music");
    }
}

The interesting thing here is that you create an anonymous inner class by using the new keyword followed by what looks like a class's constructor (in this case Printable()). However, note that Printable is an interface and does not have a constructor. Printable() is followed by the implementation of the print method. Also, note that after the closing brace, you use a semicolon to terminate the statement that instantiates the anonymous inner class.

In addition, you can also create an anonymous inner class by extending an abstract or concrete class, as demonstrated in the code in Listing 14.8.

Listing 14.8: Using an anonymous inner class with an abstract class


abstract class Printable {
    void print(String message) {
    }
}

public class AnonymousInnerClassTest 1{
    public static void main(String[] args) {
        Printable printer = new Printable() {
            public void print(String message) {
                System.out.println(message);
            }
        }; // this is a semicolon

        printer.print("Beach Music");
    }
}

Note

Anonymous classes are often used in Swing applications. See Chapter 16, “Swinging Higher” for details.

Behind Nested and Inner Classes

The JVM does not know the notion of nested classes. It is the compiler that works hard to compile an inner class into a top level class incorporating the outer class name and the inner class name as the name, both separated by a dollar sign. That is, the code that employs an inner class called Inner that resides inside Outer like this


public class Outer {
    class Inner {
    }
}

will be compiled into two classes: Outer.class and Outer$Inner.class.

What about anonymous inner classes? For anonymous classes, the compiler takes the liberty of generating a name for them, using numbers. Therefore, you'll see something like Outer$1.class, Outer$2.class, etc.

When a nested class is instantiated, the instance lives as a separate object in the heap. It does not actually live inside the outer class object.

However, with inner class objects, they have an automatic reference to the outer class object as shown. This reference does not exist in an instance of a static nested class, because a static nested class does not have access to its outer class's instance members.

How does an inner class object obtain a reference to its outer class object? Again, this happens because the compiler changes the constructor of the inner class a bit when the inner class is compiled, namely it adds an argument to every constructor. This argument is of type the outer class.

For example, a constructor like this:

public Inner()

is changed to this.

public Inner(Outer outer)

And, this

public Inner(int value)

to

public Inner(Outer outer, int value)

Note

Remember that the compiler has the discretion to change the code it compiles. For example, if a class (top level or nested) does not have a constructor, it adds a no-arg constructor to it.

The code that instantiates an inner class is also modified, with the compiler passing a reference to the outer class object to the inner class constructor. If you write:


Outer outer = new Outer();
Outer.Inner inner = outer.new Inner();

the compiler will change it to


Outer outer = new Outer();
Outer.Inner inner = outer.new Inner(outer);

When an inner class is instantiated inside the outer class, of course, the compiler passes the current instance of the outer class object using the keyword this.


// inside the Outer class
Inner inner = new Inner();

becomes


// inside the Outer class
Inner inner = new Inner(this);

Now, here is another piece of the puzzle. How does a nested class access its outer class's private members? No object is allowed to access another object's private members. Again, the compiler changes your code, creating a method that accesses the private member in the outer class definition. Therefore,


class TopLevel {
    private int value = 9;
    class Inner {
        int calculate() {
            return value;
        }
    }
}

is changed to two classes like this:


class TopLevel {
    private int value = 9;
    TopLevel() {
    }
    // added by the compiler
    static int access$0(TopLevel toplevel) {
        return toplevel.value;
    }
}
class TopLevel$Inner {
    final TopLevel this$0;
    TopLevel$Inner(TopLevel toplevel) {
        super();
        this$0 = toplevel;
    }
    int calculate() {
        // modified by the compiler
        return TopLevel.access$0(this$0);
    }
}

The addition happens in the background so you will not see it in your source. The compiler adds the access$0 method that returns the private member value so that the inner class can access the private member.

Summary

A nested class is a class whose declaration is within another class. There are four types of nested classes:

images Static nested classes

images Member inner classes

images Local inner classes

images Anonymous inner classes



The benefits of using nested classes include hiding the implementation of a class completely and as a shorter way of writing a class whose instance will only live within a certain context.

Questions

1. What is a nested class and what is an inner class?

2. What can you use nested classes for?

3. What is an anonymous class?