Best Movie Speech

Posted by Duty Until Death | 10:27 AM | 0 comments »

Pursuit of Happyness Speech Christopher Gardner
Hey...
Don't let somebody tell you,
you can't to something,
Not even me...
All right?

You got a dream?
You gotta protect it.
People can't do something themselves.
They wanna tell you that you can't do it.

You want something....
Go Get it.....


Rocky Balboa Speech to his son

Let me tell you something, that you already know .....
The world ain't all sunshine and rinbows,
It's a very mean, and nasty place,
And i don't care how tough you are,
It will beat you to your knees,
And keep you there permanently,
IF YOU LET IT...

You, me or nobody, is gonna hit as hard as life.
But ain't about you how hard you hit ...
It's about how hard you can get hit,
and keep moving forward ....
how much you can take,
and keep moving forward...

THATS HOW WINNING IS DONE!

Now , if you know what you worth,
go out and get what you worth.
But you gotta be willing to take the hits.
And not pointing fingers saying:
You ain't what you wanna be because of him,
Or her or anybody.

Cowards do that and that ain't you!

You're better than that!

woh lamhe

Use them, throw them

Listen, my love, I just want success.
At any cost
And i can do anything to have it
Fairplay if possible
Foulplay if necessary

if there is no hope
we will invent it

love gives life,
it doesn't take life

It is madness .....

Posted by Duty Until Death | 9:17 PM | 0 comments »

It is madness.....

To hate all roses
because you got scratched with one thorn .....

To give up your dreams
because one didn't come true ......

To lose faith in prayers
Because one was not answered ......

To give up on your efforts
Because one of them failed .....

To condemn all your friends
Because one betrayed you .....

Not to believe in love
Because someone was unfaithful or didn't love you back .....

To throw away all your chances to be happy
Because you did not succeed on the first attempt .....

I hope that as you go on your way
You don't give in to madness

Remembering always ......

Another chance may come up

Another friends

A new love

A renewed strength

Be persistent
Look for happiness in every day

The sure path to failure is to give up! It is often through failure that future success come - KEEP TRYING !

God Bless You




Gujarati Shayari

Posted by Duty Until Death | 6:30 PM | 0 comments »

Na Sarovar ma dubya, na samandar ma dubya,
Dubi gaya tamari ankho ni jheel ma,
Ek jotish ni kaheli vaat che,
Mane saache j pani ni ghaat che.....

******************************************

Sagar puche che reti ne : Bhinjvu tane ke kem ?
Sagar puche che reti ne : Bhinjvu tane ke kem ?
Reti mann ma roi padi : Aam kai puchi puchi ne thata hase prem.

******************************************

jane chhe chata anjan bane chhe,
aevi rite shu kam mane heran kare chhe,
mane puche che ke tane shu game chhe,
kavi rite kahu ke mane tu game che.

*****************************************


Shu karu fariyaad tane ke
Fariyaad Maaj Fari Yaad Chhe
Fari Fari Ne Yaad Tari
Ej Mari Fariyad Chee...


*****************************************

Prem kare ene jagat maaf nathi kartu
Koi eni saathe insaaf nathi kartu.
Loko prem ne paap kahe to che,
pan kaun evu che aa paap nathi kartu?

*****************************************


God Has A Plan

Posted by Duty Until Death | 4:09 PM | 0 comments »

Friends, today i will share one of best motivational story with you guys & gals which i read on internet.Hope you like it.

Once there were three trees on a hill in the woods. They were discussing their hopes and dreams when the first tree said,"Someday I hope to be a treasure chest. I could be filled with gold, silver and precious gems. I could be decorated with intricate carving and everyone one would see the beauty."

Then the second tree said, "Someday I will be a mighty ship. I will take kings and queens across the waters and sail to the corners of the world. Everyone will feel safe in me because of the strength of my hull."

Finally the third tree said," I want to grow to be the tallest and straightest tree in the forest. People will see me on top of the hill and look up to my branches, and think of the heavens and God and how close to them I am reaching. I will be the greatest tree of all time and people will always remember me.

After a few years of praying that their dreams would come true, a group of woodsmen came upon the trees. When one came to the first tree he said, "This looks like a strong tree, I think I should be able to sell the wood to a carpenter"... and he began cutting it down. The tree are happy, because he knew that the carpenter would make him into a treasure chest.

At the second tree a woodsman said,"This looks like a strong tree, I should be able to sell it to the shipyard." The second tree was happy because he knew he was on his way to becoming a mighty ship.

When the woodsmen came upon the third tree, the tree was frightened because he knew that if they cut him down his dreams would not come true. One of the woodsmen said, "I don't need anything special from my tree so I'll take this one",and he cut it down.

When the first tree arrived at the carpenters, he was made into a feed box for animals. He was then placed in a barn and filled with hay. This was not at all what he had prayed for. The second tree was cut and made into a small fishing boat. His dreams of being a mighty ship and carrying kings had come to an end. The third tree was cut into large pieces and left alone in the dark. The years went by, and the tree forgot about their dreams.

Then one day, a man and woman came to the barn. She gave birth and they placed the baby in the hay in the feed box that was made from the first tree. The man wished that he could have made a crib for the baby, but this manager would have to do. The tree could feel the importance of this event and knew that it had held the greatest treasure of all time. Years later, a group of men got in the fishing boat made from the second tree. One of them was tired and went to sleep.
While they were out on the water, a great storm arose and the tree didn't think it was strong enough to keep the men safe. The man woke the sleeping man, and he stood and said, "Peace" and the storm stopped. At this time, the tree knew that it had carried the king of Kings in its boat.

Finally, someone came and got the third tree. It was carried through the streets as the people mocked the man who was carrying it. When they came to a stop, the man was nailed to the tree and raised in the air to die at the top of a hill. When Sunday came, the tree came to realize that it was strong enough to stand at the top of the hill and be as close to God as was possible, because Jesus had been crucified on it.

The moral of the story is that when things don't seem to be going your way, always know that God has a plan for you. If you place your trust in Him, He will give you great gifts. Each of the trees got what they wanted, just not in the way they had imagined. We don't always know what God's plans are for us. We just know that His ways are not our ways, but His ways are always best.





Story to Live By

Posted by Duty Until Death | 4:00 PM | 0 comments »

There was a blind girl who hated herself because she was blind. She hated everyone, except her loving boyfriend. He was always there for her. She told her boyfriend,"If I could only see the world, I will marry you."

One day, someone donated a pair of eyes to her. When the bandages came off, she was able to see everything, including her boyfriend.

He asked her, 'Now that you can see the world, will you marry me?' The girl looked at her boyfriend and saw that he was blind. The sight of his closed eyelids shocked her. She hadn't expected that. The thought of looking at them the rest of her life led her to refuse to marry him.

Her boyfriend left in tears and days later wrote a note to her saying:'Take good care of your eyes, my dear, for before they were yours, they were mine.'

This is how the human brains often works when our status changes. Only a very few remember what life was before, and who was always by their side in the most painful situations.

Bullet :: A person should not be too honest. Straight trees are cut first and honest people are screwed first.

Soul - Our First Wife

Posted by Duty Until Death | 7:06 PM | 0 comments »

Guys and Gals, HAPPY NEW YEAR. Today new year beginning. All my family members went outside to meet friends and relatives. Due to god blessing i am not so social ,I spend my whole day at home and read some books.When i was seat alone,i was thinking is it worth to spend 2000 Crore in diwali festival. People serve lots of items to god through Annakut celebration. While, In india 60% people don't efforts to buy their 2 times meal,while we spend money in fire crackers. Anyway i will share my thoghts with you people later on. Today i will share one of favourite article with you guys,which i read on internet today. Author trying to cover whole Geeta Saar in this story.

There was a rich Merchant who had 4 wives.He loved the 4th wife the most and adorned her with rich robes and treated her to delicacies. He took great care of her and gave her nothing but the best.

He also loved the 3rd wife very much, He's very proud of her and always wanted to show off her to his friend. However, the merchant is always in great fear that she might run away with some other men.

He too, loved his 2nd wife. She is a very considerable person, always patient and in fact is the merchant's confidante. Whenever the merchant faced some problems, he always turned to his 2nd wife and she would always help him out and tide him through difficult times.

Now, the merchant's 1st wife is a very loyal partner and made great contributions in maintaining his wealth and business as well as taking care of the household. However, the merchant did not love the first wife and although she loved him deeply, he hardly took notice of her.

One day, the merchant fell ill. Before long, he knew that he was going to die soon. He thought of his luxurious life and told himself, "Now I have 4 wives with me. But when I die, I'll be alone. How lonely I'll be!"

Thus, he asked the 4th wife, "I loved you most, endowed you with the finest clothing and showered great care over you. Now that I'm dying, will you follow me and keep me company?""No way" replied the 4th wife and walked away without another word.

The answer cut like a sharp knife right into the merchant's heart, The sad merchant then asked the 3rd wife,"I have loved you so much for all my life. Now that I'm dying, will you follow me and keep me company?" "No!" replied 3rd wife."Life is so good over here! I'm going to remarry when you die!" The merchant's heart sank and turned cold.

He then asked the 2nd wife,"I always turned to you for help and you've always helped me out. Now I need your help again. When I die, will you follow me and keep me company?" "I'm sorry, I can't help you out this time!" replied the 2nd wife. "At the very most, I can only send you to your grave."The answer came like a lot a bolt of thunder and the merchant was devastated.

Then a voice called out : "I'll leave with you. I'll follow you no matter where you go." The merchant looked up and there was his first wife. She was so skinny, almost like she suffered from malnutrition. Greatly grieved, the merchant said, "I should have taken much better care of you while I could have!"

Actually, we all have 4 wives in our lives.


a) The 4th wife is our body, No matter how much time and effort we lavish in makingit look good, it'll leave us when we die.

b) Our 3rd wife, Our possessions, status and wealth. When we die, they all go others.

c) The 2nd wife is our family and friends. No matter how close they had been there for us when we're alive, the furthest they can stay by us is up to the grave.

d) The 1st wife is in fact our soul, often neglected in our pursuit of material,wealth and sensual pleasure.

Guess what? It is actually the only thing that follows us wherever we go. Perhaps it's a good idea to cultivate and strenghten it now rather than to wait until we're on our deathbed to lament.

Think Twice Before You Act

Posted by Duty Until Death | 4:34 PM | 0 comments »

Friends, Before few weeks ago i read one story on internet. After long time i get enough time to write-down my blog,today i will share that story with you people. Hope you guys like it, if you get any good things from this article i feel my time to writing blog is worth.

Before few years ago when an ice cream sundae cost much less,a 10-year-old boy entered a hotel coffee shop and sat at a table.A waitress put a glass of water in front of him."How much is an ice cream sundae?" he asked.

"Fifty cents," replied the waitress.

The little boy pulled his hand out of his pocket and studied the coints in it. "well, how much is a plain dish of ice-cream?" he inquired. By now, more people were waiting for a table and the waitress was growing impatient.

"Thirty-five cents," she brusquely replied.

The little boy again counted his coins."I'll have the plain ice cream," he said.

The waitress brought the ice cream, put the bill on the table and walked away. The boy finished the ice cream, paid the cashier and left. When the waitress came back, she began to cry as she wiped down the table. There, placed neatly beside the empty dish, were two nickles and five pennies. You see, he couldn't have the sudae, because he had to have enough left to leave her a tip.

Bullet:: Anger makes you smaller, while forgiveness forces you to grow beyond what you were.
1) When anger rises, think of the consequences.
2) Never forget what a man says to you when he is angry.

Eleven Teachings of Sai Baba

Posted by Duty Until Death | 8:57 PM | 0 comments »

Those who steps in shiradi, their sufferings will end.

Those who climbs the steps of Dwarkamai, misery will leave them.

I will be vigilence and watchful even after leaving my body.

My samadhi will bless and take care of my devotees.

I will be active and concerned even from my tomb.

Consider me to be alive, always and recognize my presence.

I am always there for those who need me and seek refuge in me.

If you look to me, I look after you.

If you cast your burden on me, I will beat it.

If you seek my help, it shall be yours at once.

There shall be no want in the house where I am.

Fakir Golden Thoughts

Posted by Duty Until Death | 5:53 PM | 0 comments »

In life just don't trust people,
who change their feelings with time .....

Instead trust those people
whose feelings remain the same,
even when the time change.....

************************************************

We make them cry who care for us.
We cry for those who never care for us.
And we care for those who will never cry for us.

This is the truth of life, its strange but true.
Once you realise this, its never too late to change.

***********************************************

Never explain yourself to any one.

Because the person who likes you doesn't need it,
and the person who dislikes you won't believe it.

***********************************************

Don't let someone become a priority in your life,
when you are just an option in their life......

Relationship work best when they are balanced.


***********************************************

Don't write your name on sand, waves will wash it away.
Don't write your name in sky, wind may blow it away.

Write your name in hearts of people you come in touch with.
That's where it will stay.

************************************************

Whatever you gives to life, it gives you back.
Do not hate anybody.
The hatred which comes out from you will someday comeback to you.
Love others. And Love will come back to you.

**********************************************************

For everything you have missed, you have gained something else;
And for everything you gain, you lose something else.
It is about your outlook towards life. You can either regreat or rejoice.

**********************************************************

Arrow goes forward only after pulling in to backward.
Bullet get forward only after pressing the trigger backward.

Every human being will get happy
only after facing the difficulties in their life path.


**********************************************************

Remember you are born to live.
Don't live because you are born!

Don't go the way life takes you.
Take life the way you go!

**********************************************************

LIVE YOUR DREAMS

"Vision without action is merely a dream. Action without vision just
passes the time. Vision with action can change the world." --Joel Barker

**********************************************************

What we are today is result of our own past actions;
Whatever we wish to be in future depends on our present actions;
Decide how you have to act now.

We are responsible for what we are, whatever we wish ourselves to be.
We have the power to make ourselves.

*********************************************************

Over the same sea, on the same winds;
A ship sails in one direction, another in opposite.
It is not the wind that decided which direction the ship goes;
Its the sails; how they are tied and how they are maneuvered.

Similarly, it is not fate that decides where your life is going;
It is all about how you take life and where you take it to.


Galti Meri Thi

Posted by Duty Until Death | 9:07 AM | 0 comments »

Usne Mujhe Chaha Hi Nahi,
Main Chahat Samajh Betha,
Galti Meri Thi.....

Uski Pal Bhar Ki Muskurahat Ko Pyar Samajh Betha,
Galti Meri Thi.....

Wo To Her Baat Per Haan Karti Thi,
Main He Iqraar Samajh Betha,
Galti Meri Thi.....

Usne Mujh Se Ziyada Ahmiyat De Mere Doston Ko,
Me Uski Ye Ada Mazaak Samajh Betha,
Galti Meri Thi.....

Usne Kaha B Tha Koi Aur Hai Meri Zindagi Main,
Main He Khud Ko Uski Zindagi me Samajh Betha,
Galti Meri Thi.....


Not:: Take above contents from Internet.

Fakir Platinum Collection

Posted by Duty Until Death | 1:29 PM | 0 comments »

तुम्हारी इस अदा का क्या जवाब दू ,
अपने दोस्त को क्या उपहार दू |
कोई अच्छा सा फूल होता तो माली से मंगवाता
जो खुद गुलाब है उसको क्या गुलाब दू ||

******************************************************

रात इतनी हसीं थी, के सारे सो रहे थे |
हम ही ऐसे बदनसीब थे, जो आप की याद में रो रहे थे ||

******************************************************

तुमने भी रंगोली सजाई होगी
मतवाली दिवाली मनाई होगी |
बुझा हुआ चिराग देखकर
हमारी याद तो आई होगी ||

****************************************************

हर इनकार तेरे इकरार से अच्छा होगा
मेरा हर दिन तेरी उस रात से अच्छा होगा
न हो यकीं तो झांक लेना अपनी डोली से
मेरा जनाज़ा तेरी बारात से अच्छा होगा

***************************************************

न करो वो वादा जिसे तुम निभा न सको ,
मत चाहो उसे जिसे तुम पा न सको ,
प्यार कहाँ किसी का पूरा होता है ,
प्यार का पहला अक्षर ही अधुरा होता है

***************************************************

हर सवाल का जवाब मिले जरुरी तो नहीं ,हर आँखों को खवाब मिले जरुरी तो नहीं
भगवन की आदत है इम्तिहान लेना,हर इम्तिहान मै हम पास हो जरुरी तो नहीं |

**************************************************

Do Not Hurt Yourself

Posted by Duty Until Death | 10:30 AM | 0 comments »

One Night a snake while it was looking for food, entered a carpenter's workshop.

The carpenter, who was a rather untidy man, had left several of his tools lying on the floor. One of them was a saw. As the snake went round and round the shop, he climbed over the saw, which gave him a little cut.

At once, thinking that the saw was attacking him, he turned around and bit it so hard that his mouth started to bleed. This made him very angry. He attacked again and again until the saw was blood and seemed to be dead.

Dying from his own wounds, the snake decided to give one last bite then turned away. The next morning the carpenter was surprised to find a dead snake on his doorstep.

Lessons to learn : Sometimes in trying to hurt others, we only hurt ourselves.

Chanakya Great Hindu Pandit

Posted by Duty Until Death | 7:52 PM | 0 comments »

Guys & Gals, Today in this blog i will share few golden quotes spoken by one of Great Hindu Pandit,Chanakya.

-- A man is great by deeds, not by birth.

-- A person not too be honest. Straight trees are cut first and honest people are screwed first.

-- A man is born alone and die alone; and he experience the good and bad consequences of his karma alone; and he goes alone to hell or the supreme abode.


--As soon as the fear approaches near, attack and destroy it.


-- Books are as useful to a stupid person as a mirror is useful to a blind person.


-- Education is the best friend. An educated person is respected everywhere. Education beats the beauty and youth.


-- Even is a snake is not poisonous, it should pretend to be venomous.


-- God is not present in idols. Your feelings are your god. The soul is your temple.


-- A good wife is one who serves her husband in the morning like a mother does, loves him in the day like a sister does and pleases him like a prostitute in the night.

-- As a single withered tree, if set aflame, causes a whole forest to burn, so does a rascal son destroy a whole family.


-- As long as your body is healthy and under control and death is distant, try to save your soul; When death is immanent what can you do?


-- A wicked wife, a false friend, a saucy servant and living in a house with a serpant in it are nothing but death.

-- Even a pandit comes to grief by giving instruction to a foolish disciple, by maintaining a wicked wife, and by excessive familiarity with the miserable.

--One should save his money against hard times, save his wife at the sacrifice of his riches, but invariably one should save his soul even at the sacrifice of his wife and riches.

-- Save your wealth against future calamity. Do not say,"What fear has a rich man, of calamity?" When riches begin to forsake one even the accumulated stock dwindles away.

-- Do not inhabit a country where you are not respected, cannot earn your livelihood, have no friends, or cannot acquire knowledge.

--Do not stay for a single day where there are not these five persons; a wealthy man, a brahmin well versed in Vedic lore, a king, a river and a physician.

-- Test a servant while in the discharge of his duty, a relative in difficulty, a friend in adversity, and a wife in misfortune.

-- He is a true friend who does not forsake us in time of need, misfortune, famine, or war, in a king's court, or at the crematorium (smasana)

-- A wise man should marry a virgin of a respectable family even if she is deformed. He should not marry one of a low-class family, through beauty. Marriage in a family of equal status is preferable.

-- Do not put your trust in rivers, men who carry weapons, beasts with claws or horns, women, and members of a royal family.

-- Women have hunger two-fold, shyness four-fold, daring six-fold, and lust eight-fold as compared to men.

-- Do not put your trust in a bad companion nor even trust an ordinary friend, for if he should get angry with you, he may bring all your secrets to light.

--Knowledge is lost without putting it into practice; a man is lost due to ignorance; an army is lost without a commander; and a woman is lost without a husband.

--Rain which falls upon the sea is useless; so is food for one who is satiated; in vain is a gift for one who is wealthy; and a burning lamp during the daytime is useless.

-- O Wise Man! Give your wealth only to the worthy and never to others. The water of the sea received by the clouds is always sweet.

-- The wise man should restrains his senses like the crane and accomplish his purpose with due knowledge of his place, time and ability.

-- Scriptural lessons not put into pratice are poison; a meal is poison to him who suffers from indigestion; a social gathering is poison to a poverty stricken person; and a young wife is poison to an aged man.

-- As long as your body is healthy and under control and death is distant, try to save your soul; when death is immanent what you can do?

Geeta Saar

Posted by Duty Until Death | 1:26 PM | 0 comments »

WHATEVER HAPPENED WAS GOOD
WHATEVER IS HAPPENING IS GOOD
WHATEVER WILL HAPPEN WILL ALSO BE GOOD
WHAT HAVE YOU PARTED WITH THAT MAKES YOU CRY ?
WHAT DID YOU BRING WITH YOU THAT YOU HAVE LOST ?
WHAT DID YOU CREATE WHICH IS NOW DESTROYED ?
WHAT YOU HAVE TAKEN, YOU HAVE TAKEN ONLY FROM HERE.
WHAT WAS GIVEN WAS GIVEN ONLY FROM HERE.
WHAT IS YOURS TODAY, WAS SOMEONE ELSE'S YESTERDAY, WILL BE SOMEONE ELSE'S TOMORROW.
CHANGE IS THE LAW OF THE UNIVERSE


जो हुआ वह अच्छा हुआ,
जो हो रहा है, वह भी अच्छा हो रहा है
जो होगा, वह भी अच्छा होगा
तुम्हारा क्या गया, जो तुम रोते हो ?
तुम क्या लाये थे, जो तुमने खो दिया ?
तुमने क्या पैदा किया, जो नुष्ट हो गया?
तुमने जो लिया, यही से लिया;
जो दिया, यही पर दिया ;
जो आज तुम्हारा है, कल किसी और का था,
कल किसी और का होगा
परिवर्तन ही संसार का नियम है

Mother - Best Gift from GOD

Posted by Duty Until Death | 3:03 PM | 0 comments »

Mother, Most influenced word in dictionary. First question arise in our mind is, What is mother? A word that is no definition, But if you want to define this word, simply say

Mother
-- Combination of Brahma, Vishnu and Mahesha.
Mother -- Key to heaven, Divine gift from Allah, means unconditional love.
Mother -- That was the bank where we deposited all our hurts and worries - T.DeWitt Talmage

Bullet :: Being a full time mother is one of the highest salaried jobs....since the payment is pure love. -- Mildred B. Vermont

Mother gives awful support to their childrens. Not only do mothers support their children, but they also often hold whole family structure together.

When i write this blog few lines immediately comes in my mind.

काशी काबा छोड़ दे मत कर चारों धाम
थाम सके तो बावरे माँ का आँचल थाम

गीले में सोती रही सूखे में था लाल
माता तेरे त्याग की जग मै नहीं मिशाल

धरती, जननी और गौ सब माँ के विस्तार
सुखा नहीं सकते कभी हम इनके उपकार

माँ, बीवी या बेटिया तीन नार के रूप
तीनो मै ही है निहित सारे शक्ति स्वरुप

माता साथ न छोड़ती महज़ त्यागती देह
बस जाती घर बास-सी जोह खेतो मै मेह -- By ओम प्रकाश (A well-known Poet)

Bullet :: "God could not be every where, and therefore he made mothers"

I read one article few days ago, author mention conversation between a baby and God.
A baby asked God , "They tell me you are sending me to earth tomorrow, but how am I going to live there being so small and helpless?"

God Said, "Your angel will be waiting for you and take care of you".

The child further inquired, "But tell me, here in heaven I don't have to do anything but sing and smile to be happy."

God Said,"Your angel will sing for you and will also smile for you. And you will feel your angel's love and be very happy."

Again the child asked, "And how am I going to be able to understand when people talk to me if i don't know the language?"

God Said,"Your angel will tell you the most beautiful and sweet words you will ever hear, and with much patience and care, your angel will teach you how to speak."

Child asked, "And what I going to do when I want to talk to you?"

God Said,"Your angel will place your hands together and will teach you how to pray."

Child asked, "Who will protect me?"

God Said,"Your angel will defend you even if it means risking it's life."

Child asked again,"But I will always be sad because I will not see you anymore."

God Said,"Your angel will always talk to you about Me and will teach you the way to come back to Me, even though I will always be next to you."

At that moment there was much peace in Heaven, but voices from Earth could be heard and the child hurriedly asked, "God, If i am to leave now, please tell me my angel's name."

God Said , "You will simply call her, 'Mom.' "

Bullet :: People are safe under one roof that is Mother.

Few days ago I meet one of my childhood friend, who did his MBA from IIT and got a job offer from RBS. He gave a party for his achievments. Few friends were together suddenly one gal asked , to whom you credit for your success.

To our disbelief he said his "Fiance". I was shock, as per my nature, i asked him, how she is responsible for your success? You know her from last 4 years. Did she inspire you? Did she take care of you? He says this girl motivated me to crack MAT, always ready to support me irrespective of condition; we are made for each other.

By hearing this statement i was laughing because i knew his mother very well, i knew how many hurdles she faced to make his child's life. That guys' s mother used to work as a maid. I told that guy he was wrong, behind his success only one person was responsible and that was his Mother.Your Mother's blessings drove your success. We had a very hot discussion on this topic. That guy and his fiance and few other firends were against me, I told him only one sentence if you want to know the importance of your mother take 4 kg. brick and tight on your stomach for 9 months you will realize importance of mother and after 9 month if you don't realize you are educated uneducated person.

Bullet :: Never marry a man who hates his mother, because he'll end up hating you.
Never marry a woman who hates your mother, because she'll make your life miserable.


Few years ago i show one girl for marriage. I visited her house with my parents. She is well educated, in short she is nubile. She asked me lots of questions related to future planning, hobby, education etc. It was my first meeting with any girl, so i was little bit afriad & shy. I asked her single question, Are you ready to stay in joint family. Suddenly her face expression chage, she says i can't. By hearing her answer i was shocked. When my parents asked me about my answer, i told them i can't spend my whole life with this girl. We have a good family relations so my father insist me to marry that girl, and finally i am ready. At that time i am very tense, generally i don't spend more than 15 minute for praying, but after that incident i spend more than 45 minute and request god to save me from this situation. Can you believe, god hear my pray and that girl rejected me because she want to stay in India and i want to spend some time in USA. I believe God is OmniPresent.

माँ है
तो लोरी है। शगुन है
माँ है
तो गीत है। उत्सव है
माँ है
तो मंदिर है। मोक्ष है
माँ है
तो मुमकिन है शहंशाह होना,
माँ के आँचल से बड़ा
दुनिया में कोई साम्राज्य नहीं। -- By डॉ. सरोज कुमार वर्मा

At last, one of my favourite quote for those people who are lovers and says my boyfriend/girlfriend is more important for me. My parents can't understand my love, A person who don't understand their parents feelings they don't understand their life partner. I heartly insist everyone to see attached power point slides.

Bullet :: Mothers hold their children's hands for a short while, but their hearts forever.

Describing mothers love is virtually impossible. It is a feeling that can only truly be understood by those that experience it. In time, a mother's daughters will grow up to be mothers themselves. Never underestimate the influence that a mother has over child. It may not always appear this way, but children look to their mother for guidance on how they should deal with situations.

(If I die today, people will cry for 1-2 days after few days people forget me. My brother/sisters, my wife, my kids, all my relatives forgets me after few months. After few years my image will be ruine out from their mind, in this world ,only one person who will cry till she goto heaven, and that person is my Mother. Every time when she meet my friends or any other person who is equivalent to my age. She show my childhood in my kids and every moment she remember me.)
At last, I am very thankful to god, for giving me lovable mother.

Bullet :: There is no substitute for mother.

पत्नी पसंदगी से मिली हुई चीज़ है
माँ पुण्य से मिली हुई चीज़ है
पसंदगी से मिली हुई चीज़ के लिए,
पुण्य से मिली हुई चीज़ को मत ठुकराना






Anger Vs. Love

Posted by Duty Until Death | 5:33 PM | 0 comments »

Sometimes in our life when something bad happen knowingly or unknowingly ,we will angry on people and scold them or loose our temper.We don't have to take any decision while we are angry it will be harmful for us as well as to other people.Before few weeks ago, I read one real story on Internet. I share this story with you guys and gals, hope it will be helpful for you.

A man was polishing his car,his small kid who is in junior kg playinig around, he suddenly picked up stone and scratched lines on the side of the car.

In a franzy of rage, the man took his child's hand and hit on it multiple times, not realizing he was using a wrench.

At the hospital, the child lost all his fingers due to multiple fractures.

Then the child said to his father with pain in his eyes: 'Dad when will my fingers grow back?'

The man was so hurt that he was speechless. He went back to his car and kicked it a lot of times.

Devastated by his own actions, sitting in front of that car he looked at the scratches, his child had written 'LOVE YOU DAD'.

The next day that man commited suicide....

Anger and love have no limits, Choose the latter to have a beautiful and lovely life........

Bullet :: "Things are to be used and people are to be loved, But the problem is today's world is that, People are used and things are loved."

Java-J2EE Interview Questions - II

Posted by Duty Until Death | 2:12 PM | 0 comments »

Q.1 The life-cycle of a Persistent Object.
Ans.
The total number of states traversed by an object to reach its initial states is known as the life-cycle of the object.

  1. Transience
  2. Persistence
  3. Detachment

Transient is the state of an object when it is not associated with any database. Any object instantiated using the new operator in this state. Since they are not associated with any row of a table,they are destroyed.Transient objects don't come under context of a transaction. That means if the values of a transient object are updated, calling the rollback() method doesn't undo the changes made to the object.

Persistent state :: An object is said to be in a persistent state when it has a database identity. An object having a database identity simply means that the identity of the object has been set using the primary key value of the table row it represents. In short, when the identity of the object containts the value of the primary key of the table row it reaches a persistent state. To make any transient object persistent, the save method of the Persistence manager has to be called.The most important characteristic feature of an object in the persistent state is that it takes part in transactional activities.

Even in the persistent state, the object says in different states. Until the commit() method of transaction management is called with the objects as a parameter, the object remains in the new state.Whenever any value held by persistent object changes, the object becomes dirty.This state is not visible to the application. The trick used by Hibernate is known as Transparent-Level Write-Behind.The framework does this by delaying the synchronization of the object to the database table and then hides the details from the application.

This feature leads us to another feature where only those column values are updated which are modified. To do so the dynamic-update attribute to the node of the mapping file is used.Finally an object in the persistent state can be made transient by calling the delete() method of the persistence manager with the object as a parameter.

Detached State :: In hibernate, when the transaction completes by calling the close() method on the Session object, the instance of persistence class lose their association with the Persistence manager. Thus the detached state is attained. In this state the object is no longer under the management of hibernate. Though the Persistence or Transaction manager is no longer managing the object, it still contains the persistent data (data contained in the row of the corresponding table).

Q.2 what is the difference between JSP forward and Servlet forward methods?

Ans. JSP forwards forwards the control to another resource available in the same webapplication on the same container, where as Servelet container forward forwards the control to another resource available in the same web application or different web application on the same contrainer.

Q.3 What is the difference between include directive and jsp:include action?

Ans. jsp:include tag includes the jsp during runtime whereas the <@ include> the specified jsp during compilation time. If we modify a jsp that is included in <@include> tag then the change will not be reflected since we are not compiling, the jsp with <@include> whereas it gets reflected when using jsp:include

Q.4 How I can implement a thread-safe JSP page?

Ans. We can make our JSPs thread-safe by having them implement the SingleThreadModel interface.This is done by adding the directive <%@ page isThreadSafe="false"%>within our JSP page.

Q.5 What are the implicit objects in JSP & difference between them?

Ans. There are 9 implicit objects defined in JSP are: application, config, exception, out, page, pageContext, request, response and session.

The main difference between these objects lies in their scope and the data they handles.

1. application interface (javax.servlet.ServletContext) Refers to the web application's enviornment.

2 Session interface (javax.servlet.http.HttpSession) Refers to the User's session.

3 request interface (javax.servlet.http.HttpServlet.Request) Refers to the current request page.

4 response interface (javax.servlet.http.HttpServlet.Response) Refers to the current response to the client.

5 out class (javax.servlet.jsp.JspWriter) Refers to the output stream for the page.

6 page class(javal.lang.Object) Refers to the page's servlet instance

7 pageContext class (javax.servlet.jsp.PageContext) refers to the page's enviornment.

8 config interface (javax.servlet.ServletConfig) Refers to the servlet's configuration

9 exception class (java.lang.Throwable) used for error handling.

Lehro se dar kar

Posted by Duty Until Death | 9:56 PM | 0 comments »

लहरों से दर कर नौका पार नहीं होती
हिम्मत करने वालों की हार नहीं होती

नन्ही चींटी जब दाना लेकर चलती है
चढ़ती दीवारों पर सौ बार फिसलती है
मन का विश्वास रगों में साहस बनता है
चढ़ कर गिरना , गिर कर चढ़ना न अखरता है
आखिर उसकी मेहनत बेकार नहीं होती
कोशिश करने वालों की हार नहीं होती

डुबकियां सिन्धु में गोटा खोर लगाता है
जा जा कर खाली हाथ लौट आता है
मिलते न सहज ही मोती पानी में
बहता दूना उत्साह इस्सी हैरानी में
मुट्ठी उसकी खाली हर बार नहीं होती
हिम्मत करने वालों की हार नहीं होती…

असफलता एक चुनौती है स्वीकार करो
क्या कमी रह गयी देखो और सुधार करो
जब तक न सफल हो नींद चैन की त्यागो तुम
संघर्षों का मैदान छोड़ मत भागो तुम
कुछ किये बिना हे जय जय कार नहीं होती
हिम्मत करने वालों की हार नहीं होती .

-- - Harivansh Rai Bachchan

Mathematics Short-Cuts

Posted by Duty Until Death | 3:23 PM | 0 comments »

  • which is greater 12/19 or 2/3?
    Approach is (cross multiply the numerator of one fraction with denominator with other.
    i.e. (left hand fraction) 12*3 and (right hand fraction) 19*2
    since 36 <38 that means 2/3 > 12/19
  • which one is greater 100/101 or 300/670?
    Left hand fraction will be 100*670 = 67000
    Right hand fraction will be 101*300 = 30300
    since 30300 < 67000 that means 100/101 > 300/670

Capsule ::The great pleasure in life is doing what people say you cannot do.

______________________________________________

Short-cut for any two/three digit number whose unit digit is 5.

E.g. 25*25 in this case put 5 square as it is and add 1 to previous digit and multiply it with original previous digit.

Step 1 : 5*5 = 25

Step 2: 2*(2+1)=2*3=6 , so final answer is 25*25=625

Look below examples.

35*35=[(3*(3+1))]25=1225 (always put 25 as a last two digit or say 5 square)

65*65=(6*7)25=4225; 105*105=11025; 125*125=(13*12)25=15625

25*35 in this case unit digit are same and tens digits are continus like 2,3. In this case product always end with 75 and for other digits compare 2 and 3, select greater digit-square it and deduct 1 from that square.

25*35 = [(3*3)-1]75 = 875. (here 3 is greater than 2,so take square and deduct 1)

35*45=[(4*4)-1]75= 1575 (here 4 is greater than 3,so take square and deduct 1)

105*115=[(11*11)-1]75=12075.

26*26 in this case unit digit and tens digits are same so product always end with 6, for other digits follow below steps

Step 1 : unit digit are same so multiply 6*6=36, so take 6 as a last digit and 3 as a carry.

Step 2: addition of ten digits + available carry => (2+2)+carry(3)

=> 4+3

=> 7, so second digit is 7.

Step 3: Now add 1 to previous digit and multiply it with original previous digit.

2*(2+1)=2*3=6 , so final answer is 26*26=676

E.g. 36*36 = 1296 ; 46*46=2116 , same method work for three digit as well.

Take an example of 126*126

Step 1 : unit digit are same so multiply 6*6=36, so take 6 as a last digit and 3 as a carry.

Step 2: addition of ten digits + available carry => (12+12)+carry(3)
=> 24+3
=> 27, so second digit is 7 and take 2 as carry

Step 3: Now add 1 to previous digit and multiply it with original previous digit.
{[12*(12+1)]+carry(2)} => {[12*13]+2} => [156+2]

=>158

so final answer is 126*126 = 15876

Capsule :: A champion is someone who gets up when he can't.

Capsule::"You were created to be a CHAMPION,don't settle for anything less."

Capsule::"A brave man will fall but he cannot yield".

________________________________________________

* Some Percentage Funda *

How to find out 2 1/2 percent of a number.

Step 1 Chosse any number.

Step 2 Divide by 4.

Step 3 Move the decimal point one place to the left.

E.g. If we select two digit number 75.

Step 2 divide 75 with 4 we get 18.75

Step 3 Move decimal point one place to the left we get 1.875

So,final answer is 2 1/2% of 75 returns 1.875.

How to find out 5 percent of a number.

Step 1 Choose any number

Step 2 Move the decimal point one place to the left.

Step 3 Divide by 2.

E.g. If we select 780$ amount.

Step 2: after moving one decimal point left we get, 78$.

Step 3: now divide 78 with 2, we will get 39.

So, finally 5% of 780$ is 39

How to find out 15 percent of a number.

Step 1 Select any number.

Step 2 Multiply the number by 3.

Step 3 Divide result by 2.

Step 4 Move the decimal point one place to the left.

E.g. If we select 67 number.

Step 2. multiply number with 3, 67*3 = 201.

Step 3. divide the result by 2, we get 201/2 = 100.5

Step 4. Move the decimal point one place left we get 10.05

so, finally 15% of 67 is 10.05

How to find out 45 percent of a number.

Step 1 Select any number.

Step 2 Multiply by 9.

Step 3. divide the result by 2.

Step 4. Move the decimal point one point to the left.

E.g. If we select 77 number.

Step 2 multiply 77 with 9, 77*9=630+63=693

Step 3 divide the result by 3, we get 693/2, 346.5

Step 4 move the decimal point one left, we will get 34.65

so, finally 45% of 77 is 34.65

______________________________________________

Multiply two numbers close to 10,100,1000 etc.

E.g Multiply 92 by 98.

Step -1 Here our base is 100,so offsets are 8 and 2. Offsets are differences from base (in this case 100).

our base 100,which has 2 zeros,the product of offsets must have also 2 digits. Hence we write 16 and write as last two digits of our answer.

92 -8

98 -2

_____

16

Step-2 Now for the previous digits, just add any two numbers crosswise i.e. either (92-2) or (98-8) we get 90. This is written before 16 as follows.

92 -8

98 -2

_______

90/16

That gives 9016.That is our answer, so finally 92*98 = 9016

Now take an example of three digit numbers.

E.g. Multiply 888 by 920.

Step -1 Here our base is 1000,so offsets are 112 and 80. Offsets are differences from base (in this case 1000).


our base 1000,which has 2 zeros,the product of offsets must have also 2 digits. Hence we write 16 and write as last two digits of our answer.

888 -112


920 -80
_____
8960


Step-2 Now for the previous digits, just add any two numbers crosswise i.e. either (888 -80) or (920-112) we get 808. This is written before 960 as follows.


888 -112


920 -80
_______
808/8960 now last there digits are 960 and previous digits are (808+8)=816

That gives 81696 .That is our answer, so finally 92*98 = 816960

Capsule :: When the going gets tough, the tough get going

______________________________________________

Find out square of two digit numbers.
E.g 25*25
Step 1) 5*5 = 25, put 5 as a last digit and 2 as a carry
Step 2) (2*5)*2+2(carry) = 22. put 2 as a digit and 2 as a carry
Step 3) (2*2)+2 (carry)=6
So in this case final answer is 25*25 = 625

Take another example so you will get more idea.
E.g. 43*43
Step 1) 3*3 =09,put 9 as a last digit and o as a carry.
Step 2) (4*3)*2+0(carry)=24,put 4 as a digit and 2 as a carry.
Step 3) (4*4)+2(carry)=18
So in this case final answer is 43*43=1849

How to find the units digit.

  • to find the unit digit of x^y we only consider the units digits of the number x.
  • to calculate units digit of 237^234 we only consider digit of 7^234. Hence we find the units digit of 7^234.
  • to find the units digit of a*b, we only consider the units digits of the numbers a and b.
  • to calculate units digit of 233*254, we only consider the units digit of 233 and 254 i.e. 3 and 4,respectively.
  • Hence, we find the units digit of 3*4,respectively.To calculate units digit of x^y where x is a single digit number.

To calculate units digit of numbers in the form x^y such 7^253,8^93,3^74 etc.

Case 1:: When y is NOT a multiple of 4.
We find the remainder when y is divided by 4. Let y=4q+r where r is the remainder when y is divided by 4, and 0 < r < 4.

Case 2:: When y is a multiple of 4.
We observe the following conditions:
Even numbers 2,4,6,8 when raised to powers which are multiple of 4 give the units digit as 6.
Odd numbers 3,7 and 9 when raised to powers which are multiple of 4 give the units digit as 1.

Find the units digit of 7^33.

Ans. The remainder when 33 is divided by 4 is 1. Hence the units digit 7^33 is the unit digit of 7^1=7.

Find the units digit of 43^47.

Ans. The units digit of 43^47 can be found by finding the units digit of 3^47. 47 gives a remainder of 3 when divided by 4. Hence units digit= units digit of 3^3=7.

Find the units digit of 43^43 - 22^22.

Ans. Unit digits of 43^43 is 7 and units digit of 22^22 is 4. Hence the units digit of expression will be 7-4=3.

Find the units digit of 3^3^3.

Ans. Again, we find the remainder when the power is divided by 4. Therefore, we find the remainder when 3^3 is divided by 4. Now, 3^3=27, remainder by 4 = 3.Therefore, units digit of 3^3^3 = units digit of 3^3 = 7.

Find the unit digit of 7^11^13^17.

Ans. Again, we find the remainder when the power is divided by 4. Therefore, we find the remainder when 11^13^17 is divided by 4. Now 11 = 12 -1 => Remainder [11Odd] = Remainder[(-1)Odd] = -1 = 3.Therefore, units digit of 7^11^13^17 = units digit of 7^3 = 3.


Find the unit digit of 7^15^16^17.

Ans. Again, 16^17 means 6^17 so finally we get 6 remainder, now we get 15^6 so when we divide 5^6 we get 25,means 5 is a unit digit,so when we divide 7^5 by 4 we get 1 remainder,finally we get 7^1=7. Therefore, unit digit of 7^11^13^17 is 7.

Find the units digit of 28^28 - 24^24.

Ans. We have to find the units digit of 8^28 - 4^24. Since 28 and 24 are both multiple of 4, the units digits of both 8^28 and 4^24 will be 6. Hence the units digit of the difference will be 0.

How to find last two digits of a number.

We are dividing this method into four parts and we will discuss each part one by one.

a. Last two digits of numbers which end in one.

b. Last two digits of numbers which end in 3,7 and 9

c. Last two digits of numbers which end in 2

d. Last two digits of numbers which end in 4,6 and 8.

Last two digits of a number ending with 1.Let's start with an example.

What is the last two digits of 31^786?

Note :: multiply the tens digit of the number with the last digit of the exponent to get the tens digit. The units digit is equal to one.

So, last two digits of 31^786 is 81.

What is the last two digits of 41^2789?

Ans. (4*9=36), Therefore 6 will be the tens digit and one will be the units digit.

What is the last two digits of 71^56747

Ans. (7*7=49), Therefore 9 will be the tens digit and one will be the units digit.

Find the last two digits of 51^456 * 61^567.

The last two digits of 51^456 will be 01 and the last two digits of 61^567 will be 21. Therefore, the last two digits of 51^456*61^567 will be the last two digits of 01*21=21

Last two digits of numbers ending in 3,7 or 9.

Find the last two digits of 19^266.

19^266 = (19^2)133. Now, 19^2 ends in 61(19^2=361) therefore, we need to find the last two digits of (61)^133.

Once the number is ending in 1 we can straight away get the last two digits the help of the previous method. The last two digits are 81(6*3 = 18, so the tens digit will be 8 and last digit will be 1)

Find the last two digits of 33^288.

33^288 = (33^4)72, Now 33^4 ends in 21(33^4 = 33^2 * 33^2 = 1089 * 1089 = xxxxx21) therefore, we need to find the last two digits of 21^72. By the previous method, the last two digits of 21^72 = 41(tens digit = 2*2 = 4, unit digit =1)

So here's the rule for finding the last two digits of numbers ending in 3,7 and 9.

Convert the number till the number gives 1 as the last digit and then find the last two digits according to the previous method.

Find the last two digit of 87^474.

Ans. 87^474 = 87^472 * 87^2 = (69*69)^118 * 69 (The last two digits of 87^2 are 69) = 61^118*69 = 81 * 69 = 89

Last two digits of numbers ending in 2,4,6 or 8.

There is only one even two-digit number which always ends in itself(last two digits) - 76 i.e. 76 raised to any power gives the last two digits as 76. Therefore, our purpose is to get 76 as last two digits for even numbers. We know that 24^2 ends in 76 and 2^10 ends in 24. Also, 24 raised to an even power always ends with 76 and 24 raised to an odd power always ends with 24. Therefore, 24^34 will end in 76 and 24^53 will end in 24.

Find the last two digits of 2^543.

Ans. 2^543 = (2^10)^54 * 2^3 = (24)^54 (24 raised to an even power) * 2 ^3 = 76 * 8 = 08.

Find the last two digits of 64^236.

Ans. (2^6)^236 =2^1416=(2^10)^141*2^6 = 24^141 (24 raised to odd power) * 64 = 24*64 =36.

Now those numbers which are not in the form of 2n can be broken down into the form 2n*odd number. We can find the last two digits of both the parts separetely.

Find the last two digits of 62^586.

Ans. (2*31)^586 = 2^586 * 3^586 = (2^10)^58*2^6*31^586 = 76 * 64* 81 = 84

Find the last two digit of 54^380

Ans. (2*3^3)^380 = 2^380 * 3^1140 = (2^10)^38*(3^4)^285=76*81^285=76*01=76

Find the last two digit of 56^283

Ans. 56^283 = (2^3*7)^283=2^849*7^283=(2^10)^84*2^9*(7^4)*70*7^3 = 76*12*(01)^70*43=16

Find the last two digit of 78^379

Ans. 78^379 = (2*39)^379=2^379*(39)^379=(2^10)^37*2^9*(39^2)^189*39 = 24*12*81*39 = 92

Capsule :: "You must have long term goals to keep you from being frustrated by short term failures." -- Chalres C. Noble

________________________________________________________

* Divisibility Rules *

A number is divisible by 2, if the last two digit is even (0,2,4,6,8)

E.g. 66,68,12,14 are divisible by 2, while 129,39,49 are not.

A number is divisible by 3,if the sum of the digits is divisible by 3.

E.g. 216,213 are divisible by 3, while 215,217,107 are not divisible by 3.

A number is divisible by 4, if last two digits are divisible by 4.

E.g. 1312 is divisible by 4, while 7019 is not.

A number is divisible by 5, if last digit is 0 or 5.

E.g. 120,125,110 divisible by 5, while 809 is not.

A number is divisible by 6, if the number is divisible by 2 and 3.

E.g. 216,312 divisible by 6, while 308 is not divisible by 6.

A number is divisible by 7, if you double the last digit and substract it from the rest of the number and the answer is 0 or divisible by 7.

E.g. 2835

Here in first step we will take last digit, double it and subtract it from rest of the number.

Step -1 2835 = 283 - (5*2) = 283 - 10 = 273

Step-2 273 = 27 - (3*2) = 27 - 6 = 21 , and 21 is divisible by 7.

805 is divisible by 7, while 905 is not divisible by 7.

A number is divisible by 8, if the last three digits are divisible by 8.

E.g. 109816, here last three digit 816 is divisible by 8 = (816/8 = 102)

while 216302 is not divisible by 8.

A number is divisible by 9, if the sum of total digit is divisible by 9.

E.g. 1629 (1+6+2+9=18, and again, 1+8=9), so 1629 is divisible by 9.

while 2013 is not divisible by 9.

A number is divisible by 10, if the number ends in 0.

E.g. 110,100,120 etc. , while 111,121,107 are not divisible by 10.

A number is divisible by 11, when we substract sum of odd digit from sum of even digit and resulting number is either 0 or divisible by 11.

E.g. 1364 = (3+4) - (1+6) = 7 -7 =0 ; 121 = (1+1) - (2+0) = 2 -2 = 0 ; 561 = (5+1)-(6+0)=0

So, 1364,121,561 all are divisible by 11.

A number is divisible by 12, if it's divisible by both 3 and 4.

E.g. 648, here last two digit of 648 is 48 and it's divisible by 4. Also (6+4+8 = 18, which is divisible by 3. Finally 648 is divisible by 12.

Capsule :: Success is not final, failure is not fatal:it is the courage to continue that counts.

_______________________________________________________

Java-J2EE Interview Questions

Posted by Duty Until Death | 9:22 PM | 0 comments »

Q.1 What is the purpose of action servlet and action in struts?

Ans.
Action Servlet is backbone of struts framework. It is the main controller component. Action class contains userlogic. It returns the next view to the FrameWork.

Q.2 What is the difference between struts 1.0 and 1.1 OR what is the difference between perform() and execute() method in struts.

Ans. The struts base Action class has been modified with a new method called execute(). This method should be called instead of the perform() method. The main difference between the two is that the execute() method declares that it throws java.lang.Exception. Where as the earlier perform() method declared that it could throw IOException and ServletException. This change was necessary to facilitate the new declarative exception-handling feature that was added to struts 1.1.As a result the perform() method has been replaced by execute().Below are other differences between 1.0 and 1.1



  • Request processor class added in 1.1
  • Make some changes in web.xml and struts-config.xml files
  • Added declarative exceptionhandling feature
  • DynamicAction Forms
  • Multiple Application Modules.
  • Struts validator framework
  • Change to the ORO package
  • Change to Commons logging

Q.3 How we can manage exception-handling in struts?

Ans. There are basically two type of approaches for exception-handling.

Declarative :: In this approach exception are defined in the struts-config.xml and if the exception occurs the control is automatically passed to the appropriate error page. The tag is basically used to define the exception in the struts-config.xml file.

E.g. <action path="/logon"
type="com.candidsoftwares.LogOnAction" input="/UserDetail.jsp" >

< exception key="errormessage.logon" type="java.lang.RuntimeException" path="error.jsp" >;

</action >

In tag key="the key defines the key present in MessageResource.properties file; type=the class of the exception occured;path=the page where the control is to be followed in case exception occured;Handler=the exception handler which will be called before passing the control to the file specified in path attribute.

Another way is to define the exceptions globally by using the key.

<global-exceptions>
<exception key=”error.logon” type=”java.lang.RuntimeException” path=”/error.jsp”/>
</global-exceptions>

Programmetically --In this approach the exceptions are caught using normal java language try/catch block and instead of showing the exception some meaningful messages are displayed. In this approach the flow of control is also maintained by the programs.

Q.4 How to convert java object into byte array?

Ans. below metion code to conver java object into byte array.

public static byte[] ObjectToByte(Object obj) throws java.io.IOException {

ByteArrayOutputStream bos= new ByteArrayOutputStream();

ObjectOutputStream oos= new ObjectOutputStream();

oos.writeobject(obj);

oos.close();

bos.close();

byte[] data = bos.toByteArray();

return data;

}

Q.5 What are the benefits of ORM and hibernate?

Ans. There are many benefits from these. Out of the following are the most important one.
Productivity :: Hibernate reduces the burden of developer by providing much of funtionality and let the developer to concentrate on business logic.

Maintainability ::As hibernate provides most of the functionality, let the LOC for the application will be reduced and it is easy to maintain. By automated object/relational persistence it even reduces the LOC.

Performance::Hand-coded persistence greater than automated one.But this is not true all the times. But in hibernate, it provides more optimization that works all the time there by increasing the performance. It it is automated persistence then it still increases the performance.

Vendor independence::Irrespective of the different types of databases that are there, hibernate provides a much easier way to develop a cross platform application.

Q.6 what are core interfaces are of hibernate framework?

Ans. Below are the main interfaces used in hibernate.

Session Interface:: This is the primary interfaces used by hibernate applications. The instances of this interface are lightweight and are inexpensive to create and destroy. Hibernate sessions are not thread safe.

SessionFactory Interface::This is a factory that delivers the session objects to hibernate application. Generally there will be a single SessionFactory for the whole application and it will be shared among all the application thereads.

Configuration Interface::This interface is used to configure and bootstrap hibernate.The instance of this interface is used by the application in order to specify the location of hibernate specific mapping documents.

Transaction Interface::This is an optional interface but the above three interfaces are mandatory in each and every application. This interface abstrats the code from any kind of transaction implementation such as JDBC transaction, JTA transaction.

Query and criteria Interface::This interface allows the user to perform queries and also control the flow of the query execution.

Q.7 What are the three statements in JDBC & differences between them.

Ans. There are basically three types of statements in JDBC.

1) Statement :: Basically used to execute single SQL statement. We used createStatement() method for that.

2) Prepared Statement::Used to execute SQL statements over and over.Prepared statement is compiled only once even though it is used n number of times.We used preparedStatement()

3) Callable Statement::Used to execute multiple sql statements over and over,used to call stored procedure.We used call() method.

Q.8 What is the difference between store procedure and function.

Ans. Proceduare are parsed and compiled, they are stored in compiled format in the database where as Function are compiled and executed at runtime.

  1. Function must return a value, procedures don't need to.
  2. You can have DML statements in function,but you can not call such a functgion in SQL query.If you have a function that is updating a table, you cannot call that function from a SQL query. -- select test(field name) from XYZtablename;will throw error.

Q.9 What is serialization?

Ans. Serialization is a mechanism by which you can save the state of an object by converting it to a byte stream.whenever an object is sent over the network,objects need to be serialized.Moreover if the state of an object is to be saved, objects need to be serialized.

Q.10 What is externalizable interface?

Ans. Externalizable is an interface which contains two methods readExternal and writeExternal.These methods give you a control over the serialization mechanism.Thus if your class implements this interface, you can customize the serialization process by implementing these methods.

Q.11 What is synchronization and why is it important?

Ans. With respect to multithreading synchornization is the capatcity to control the access of multiple threads to shared resources,. Without synchornization,it is possible for one thread to modify a shared object while another thread is in the process of using or updating that object's value.

Q.12 what one should take care of while serializing the object?

Ans. One should make sure that all the included objects are serializable.If any of the objects is not serializable then it throws a NotSerializableException.

Q.13 What happens to the static field of a class during serialization?

Ans. There are three exceptions in which serialization doesn't read and write to the stream.

  1. serialization ignores static fields, because they are not part of any particular state.
  2. base class fields are only handled if the base class itself is serializable.
  3. transient fields.

Q.14 What are checked exceptions and unchecked exceptions in java?

Ans. A checked exception is some subclass of Exception(or Exception itself),excluding class RuntimeException and its subclasses.Making an exception checked forces client programmers to deal with the possibility that the exception will be thrown.

While unchecked exception are RuntimeException and any of its subclasses.Class Error and its subclasses also are unchecked.With an unchecked exception,however, the compiler doesn't force client either to catch the exception or declare it in a throws clause.In fact, client programmers may not know that the exception could be thrown.

Checked exceptions must be caught at compile time.Runtime exceptions do not need to be.

Q.15 whats the difference between notify() and notifyAll()?

Ans. notify() is used to unblock one waiting thread;notifyAll() is used to unblock all of them; Using notify() is preferable (for efficiency) when only one blocked thread can benefit from the change(for example, when freeing a buffer back into a pool).notifyAll() if multiple threads should resume(for example, when releasing a "writer" lock on a file might permit all "readers" to resume.)

Q.16 what are synchronized methods and synchornized statements?

Ans. Synchronized methods are methods that are used to control access to a method or an object. A thread only executes a synchronized method after it has acquired the lock for the method's object or class.Synchronized statements are similar to synchronized methods. A synchronized statement can only be executed after a thread has acquired the lock for the object or class referenced in the synchronized statement.

Q.17 what is the purpose of the wait(),notify() and notifyall() methods?

Ans. The wait(),notify(), and notifyAll() methods are used to provide an efficient way for threads to communicate with each other.

Q.18 What are the high-level thread states?

Ans. Below are high-level thread states.

  1. ready
  2. running
  3. waiting
  4. dead

Q.19 What is the difference between yielding and sleeping?

Ans. When a task invokes its yield() method,it returns to the ready state.When a task invokes its sleep() method, it returns to the waiting state.

Q.20 What happens when a thread cannot acquire a lock on object?

Ans. If a thread attempts to execute a synchronized method or synchronized statement and is unable to acquire an object's lock, it enters the waiting state until the lock becomes available.

Q.21 How many methods in Object class?

Ans. Below are available methods in Object class.

  1. clone()
  2. equals() and hashcode()
  3. getClass()
  4. finalize()
  5. wait() & notify()
  6. toString()

Q.22 What is the relationship between synchronized and volatile keyword?

Ans. The JVM is guaranteed to treat and writes of data of 32 bits or less as atomic.(Some JVM might treat reads and writes of data of 64 bits or less as atomic in future). For long or double variable, programmers should take care in multi-threading environment. Either put these variables in a synchronized method or blcok, or declare them volatile.

Q.23 How do you create a read-only collections?

Ans. The Collections class has six methods to help out here.

  1. unmodifiableCollection(Collection collection)
  2. unmodifiableList(List list)
  3. unmodifiableMap(Map map)
  4. unmodifiableSet(Set set)
  5. unmodifiableSortedMap(SortedMap sortedmap)
  6. unmodifiableSortedSet(SortedSet sortedset)

If you get an Iterator from one of these unmodifiable collections,when you call remove(), it will throw an UnsupportedOperationException.

Q.24 How we can implement a thread-safe JSP page?

Ans. We can make jsp thread-safe by having them implement the SingleThreadModel interface. This is done by adding the directive <%@page isThreadSafe="false" %> within your JSP Page.

Q.25 What are the lifecycle phase of a JSP?

Ans. JSP Pages looks like HTML page but is a servlet.

  1. Page transalation :: page is parsed, and a java file which is a servlet is created.
  2. Page compilation :: page is compiled into a class file.
  3. Page loading :: This class file is loaded.
  4. Create an instance :: Instance of servlet is created.
  5. jspInit() method is called.
  6. jspService() is called to handle service calls
  7. jspDestroy() is called to destroy it when the servlet is not required.

Q.26 What are the implicit objects? List them.

Ans. Certain objects that are available for the use in JSP documents without being declared first. These objects are parsed by the JSP engine and inserted into the generated servlet. The implicit objects are:

  1. request
  2. response
  3. pagecontext
  4. session
  5. application
  6. out
  7. config
  8. page
  9. exception

Q.27 What are different scope values for the <jsp:usebean>

Ans. The different scope values for are:

  • Page
  • Session
  • request
  • application

Q.28 What is the difference between WebServer and ApplicationServer?

Ans.
Webserver contains servlet engine and jsp engine. It does not provide system-level services like security management, transaction management,resource pooling etc...application server contains servlet container,jsp container and EJB contrainer. And it provides system-level services implicitly. WebServer is protocol dependent while application server is protocol independent.

Q.29 Does JVM maintain a cache by itself? Does the JVM allocate objects in heap? Is this the OS heap or the heap mainted by the JVM?

Ans. Yes, the JVM maintain a cache by itself. No it allocates the objects in stack, in heap on references. Heap maintained by the JVM because, every time the JVM should not use objects directly it uses only references that's why the heap maintained by the JVM.

Q.30 what is the main difference between jdk1.4 and jdk1.5?

Ans
. jdk 1.5 has various features which was not in jdk1.4 , These few features are below.



  1. Annotation
  2. Autoboxing
  3. Enum Support
  4. ForEach
  5. Generic implementatijon of class method wildcards bounded type.
  6. variable argument support.

Q.31 Benefits of Spring MVC over Struts?

Ans. Spring provides a very clean division between controllers,JavaBean models, and views.

  • Spring's MVC is very flexible. Unlike struts, which forces your Action and Form objects into concrete inheritance (thus taking away your single shot at concrete inheritance in Java),Spring MVC is entirely based on interfaces.Furthermore, just about every part of the Spring MVC framework is configurable via plugging in your own interfaces.Furthermore, just about every part of the Spring MVC framework is configurable via plugging in your own interface. Of course we also provide convenience classes as an implementation option.
  • Spring, like webwork, provides interceptors as well as controllers, making it easy to factor out behavior common to the handling of many requests.
  • Spring MVC is truly view-agnostic. You don't get pushed to use JSP if you don't want to;You can use Velociy,XSLT or other view technologies. If you want to use a custom view mechanism - for example, your own templating language- you can easily implement the spring interface to integrate it.
  • Spring controller are configured via IoC like any other objects. This makes them easy to test, and beautifully integrated with other objects managed by Spring.
  • Spring MVC web tiers are typically easier to test than Struts web tiers, due to the avoidance of forced concrete inheritance and explicit dependence of controllers on the dispatcher servlet.
  • The web tier becomes a thin layer on top of business object layer. This encourage good practice.Struts and other dedicated web frameworks leave you on your own in implementing your business objects; Spring provides an integrated framework for all tiers of your application.
  • No ActionForms.Bind directly to domain objects.
  • More testable code(validation has no dependency on servlet API)
  • Struts imposes dependencies on your Controller (they must extend a Struts class), Spring doesn't force you to do this although there are convenience Controller implementation tha tyou can choose to extend.
  • Struts has a well-defined interface to business layer.
  • Spring offers better intergration with view technologies other than JSP(Velociy/XSLT/FreeMaker/XL etc.)

Q.32 Why are wait(),notify() and notifyall() methods defined in the Object class?

Ans. These methods are detailed on Java Software Developement Kit JavaDoc page for the Object class, they are to implement threaded programming for all subclasses of object.

Q.33 Why are there seperate wait and sleep methods?

Ans. The static Thread. sleep(long) method maintains control of thread execution but delays the next action until the sleep time expires. The wait method gives up control over thread execution indefinitely so that other threads can run.

Q.34 Can i implement my own start() method?

Ans. The Thread start() method is not marked final, but should not be overridden. This method contains the code that creates a new executable thread and is very specialised. Your threaded application should either pass a Runnable type to a new Thread, or extend Thread and override the run() method.

Q.35 How do I serialize an object to a file?

Ans. To serialize an object into a stream perform the following actions.

  • open one of the output streams.
  • chain it with the ObjectOutputStream
  • call the method writeObject() providing the instance of a Serializable object as an argument.
  • close the streams.

try {

fout = new FileOutputStream("tests.dat");

out = new ObjectOutputStream(fout);

out.writeObject(theQueue);

}catch(IOException exp){

e.printStackTrace();

}

Q.36 How do I deserialize an object?

Ans. To deserialize an object, perform the following steps:

- Open an input stream.

- Chain it with the ObjectOutputStream - Call the method readObject() and cast the returned object to the class that is being deserialized.

- Close the stream.

try {

fin = new FileInputStream("testst.dat");

in = new ObjectOutputStream(fin);

// de-serializing theQueue.

theQueue = (Queue) in.readObject();

in.close();

} catch (Exception exp) {

exp.printStackTrace();

}

Q.37 What is the difference between an interface and an Abstract class?

Ans. An abstract class can have instance methods that implement a default behaviour. An interface can only declare contants and instance methods, but cannot implement default behavior and all methods are implicitly abstract. An interface has all public members and no implementation.

  1. Interfaces provide a form of multiple inheritance. A class can extend only one other class.
  2. Interfaces are limited to public methods and constants with no implementation. Abstract classes can have a partial implementation, protected parts, static methods etc..
  3. A class may implement several interfaces. But in case of abstract class, a class may extend only one abstract class.
  4. Interface are slow as it requires extra indirection to find corresponding method in the actual class. Abstract class are fast.

Q.38 What is the difference between "==" and "equals()" method?

Ans. "==" does shallow comparison, It returns true if two object points to the same address in the memory.While, "equals() " does deep comparison, it checks if the values of the data in the object are same.

Q.39 What is the difference between String and StringBuffer.

Ans. String is an immutable class, immutable means we can't change the value.

E.g String str = "test" // suppose memory address is 54321.

Now, we are trying to assign a new value to the variable str then

str = "test java" ; then the value of the variable at address 54321 will not change but a new momory is allocated for this variable say 12345. So, in the memory address 54321 hava "test" and the memory address 12345 will have value "test java" and the variable str will now be pointing to address 12345 in memory.

StringBuffer can be modified dynamically.

E.g. StringBuffer strt = "java" // address in memory is say 12345 and now if you assign a new value to the variable str then str = "core java" ; then value in the address of memory will get replaced, a new memory address is not allocated in this case.

_________________________________________________________________

Q.40 What are different types of inner classes?

Ans. Inner classes nest within another classes. A normal class is a direct member of a package. Basically four type of inner classes are available.

  1. Static member classes.
  2. Member classes.
  3. Local classes.
  4. Anonymous classes.

Static member classes :: a static member class is a static member of a class. Like any other static method, a static member class has access to all static methods of the parent, or top-level class.

Member classs ::a member class is also defined as a member of a class. Unlike the static variety,

_________________________________________________________________

Q.41 Explain OOPS principles?

Ans. 1) Abstraction :: It means hiding the details and only exposing the essential parts.

2)Polymorphism :: Polymorphism means having many forms. In java you can see polymorphism when you have multiple methods with the same name.

3)Inheritance ::Inheritance means the child class inherits the non private properties of the parent class.

4) Encapsulation::It means data hiding. In java with encapsulation the data by making it private and even we want some other class to work on that data then the setter and getter methods are provided.

Q.42 What is the difference between queue and stack?

Ans. Stack work on Last-in-first-out while queue work on First-in-first-out rule.

Q.43 Difference between SAX and DOM parser.

Ans. DOM parser are Object based while SAX parsers are event based.DOM parsers creates Tree in the memory whereas SAX parser does not and hence it is faster than DOM.DOM parser are useful when we have to modify the XML,with SAX parser we can't modify the XML, it is read only.

Q.44 why do we need public static void main(String args[])

Ans. public : The method can be accessed outside the class/package.

static : You need not have an instance of the class to access the method.

void : Your application need not return a value, as the JVM launcher would return the value when it exits.

main() : This is the entry point for the application.

Q.45 what is the difference between DROP,DELETE and TRUNCATE in Oralce?

Ans. DROP and TRUNCATE are DDL commands while DELETE is a DML command.

  • DROP and TRUNCATE are autocommited, while DELETE is not autocommited.
  • DELETE command removes all the rows from the table and the deleted records get logged into transaction log which slow down the performance.While truncate table also deletes the records from the table but does not log the deleted record.
  • By using TRUNCATE and DELETE we can delete the records from the database.Difference is by using DELETE we can retrieve datas using ROLLBACK but this can't be done in the case of TRUNCATE.

Q.46 What is the difference between StringBuffer and StringBuilder?

Ans. The only difference between StringBuffer and StringBuilder is that StringBuilder is unsynchronized while StringBuffer is synchronized.So when the application run in a single thread then it is better to use StringBuilder. StringBuilder is more efficient than StringBuffer.