<?xml version="1.0" encoding="UTF-8" standalone="no"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:gd="http://schemas.google.com/g/2005" xmlns:georss="http://www.georss.org/georss" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-22938274</atom:id><lastBuildDate>Fri, 30 Aug 2024 18:05:35 +0000</lastBuildDate><category>Others</category><category>AWT</category><category>About  Struts</category><category>About Ashish</category><category>Air and Java</category><category>Ashish Kumar Mishra</category><category>Ashish's Holi</category><category>E-commerce</category><category>Exception Handling</category><category>Google Desktop</category><category>Google Pack</category><category>Holi</category><category>Holi 2008</category><category>Important Acquistion</category><category>Java</category><category>Java Exception Handling</category><category>Java and Adobe Air</category><category>JavaScript</category><category>List</category><category>Merapi</category><category>MySQL Merger</category><category>NetBeans 6</category><category>Removing Element from List</category><category>Screen Shot</category><category>Screen Shot in Java</category><category>String</category><category>String Handling</category><category>StringBuffer</category><category>StringBuilder</category><category>Sun</category><category>What is E-commerce</category><title>My Thougths </title><description>I am a Network Builder and Entrepreneur. I love to talk about the Dreams, Goals &amp;amp; new technologies. I am happy to make difference in people lives. </description><link>http://ashishmishra16.blogspot.com/</link><managingEditor>noreply@blogger.com (&lt;b&gt; Ashish Kumar Mishra&lt;/b&gt;  Location:  &lt;b&gt;Pune, India&lt;/b&gt;)</managingEditor><generator>Blogger</generator><openSearch:totalResults>29</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><xhtml:meta content="noindex" name="robots" xmlns:xhtml="http://www.w3.org/1999/xhtml"/><item><guid isPermaLink="false">tag:blogger.com,1999:blog-22938274.post-5465443051945549552</guid><pubDate>Tue, 08 May 2018 09:03:00 +0000</pubDate><atom:updated>2018-05-09T00:01:41.315+05:30</atom:updated><title>Green Cleaning: Its impacts on Health &amp; Environment </title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;br /&gt;
&lt;div style="text-align: left;"&gt;
Green cleaning refers to the use of cleaning methods and products that are environmental friendly in nature as it contains ingredients and products that are designed to preserve and create no harm to the human health and environment quality.&lt;/div&gt;
&lt;a href="https://www.janiking.com/wp-content/uploads/2015/05/green-cleaning-can-save-you-money.jpg"&gt;&lt;img border="0" src="https://www.janiking.com/wp-content/uploads/2015/05/green-cleaning-can-save-you-money.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div&gt;
These green cleaning products and techniques avoid the use of materials which contain toxic or harsh chemicals some of which emit volatile organic compounds which cause respiratory, dermatological and other dreaded conditions. Products are environmental friendly and biodegradable.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Little that we verify, what it is in that container of Your favorite Cleaning Product?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Experts say that most of the cleaning products are made up of enormous amount of chemicals which can impact the health of users. As people are being more aware of the impacts and zooming in the market, people begin rethinking what they will be bringing into their homes.&lt;br /&gt;
&lt;br /&gt;
Famous water pollutant is phosphates, water-softening mineral additives that were once widely used in laundry detergents and other cleaners. When phosphates enter waterways, they act as a fertilizer, spawning overgrowth of algae. This overabundance of aquatic plant life eventually depletes the water's oxygen supply, killing off fish and other organisms.&lt;br /&gt;
&lt;br /&gt;
Products that list active ingredients of Chlorine or Ammonia, which can cause respiratory and skin irritation and will create toxic fumes if accidentally mixed together.&lt;br /&gt;
&lt;br /&gt;
The biggest impact of cleaning products comes from the chemical content which has not been tested for safety. These pollute streams and rivers and take a long time to disintegrate.&lt;br /&gt;
&lt;br /&gt;
Safety Tip: &lt;b&gt;&lt;i&gt;Avoid cleaners marked "Danger" or "Poison" on the label, and look out for other tell-tale hazard warnings, such as "corrosive" or "may cause burns."&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Reasons why we need switch to Green Cleaning products.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1.&lt;/b&gt;      &lt;b&gt;Healthier Homes&lt;/b&gt; – If one goes green, “No longer will there be chemicals absorbed into the skin or breathed in by the person cleaning,”. Family members would gain health benefits as they no longer breath in cleaners of harmful effects in the air and sitting on surfaces. Studies were also done and proved that continuous use of non-green cleaning spray even just once a week would raise risk of getting and developing Asthma. Traditional and non-green cleaning products pose risks such as chemical burns to any household owners’ skin and eyes.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;2.      Building Safe Environment &lt;/b&gt;– when you use many cleaning products, “harmful chemicals are being released into the environment.” Changing to greener methods and application of green cleaning tips will help reduce pollution to the waterways and the air and it also minimizes the impact on the ozone depletion and global climate change with fewer smog producing chemicals. Many green products also use recyclable packaging which minimizes waste.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;3.&lt;/b&gt;&amp;nbsp;&lt;b&gt;Better Air quality at Home&lt;/b&gt;– Most people cannot stand the strong stench of chemical odours. Many green cleaning products including store bought and ones you can make at home emits pleasant natural essential oils.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;b&gt;4. Cheaper &amp;amp; Cost Effective &lt;/b&gt;– Many people think that Environment friendly products are costlier. Infect these products are cheaper because they don’t contain multiple chemicals. And to hide these Chemical Odours, additional Fragrances are not required.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;"We have not inherited this earth from our ancestors but we have borrowed it from our children"&lt;/i&gt;&lt;/b&gt;. I have heard this statement many a times, but I could only understand it when I was blessed with my Son. I am realizing it more every day that I am responsible for making this place better for my Son and their generation. I am sure you also feel the same.&lt;br /&gt;
&lt;br /&gt;
Why not fill a Survey to tell your experience: &lt;a href="https://goo.gl/forms/fPjt96TQ2Bz1Us0U2"&gt;Green Clearning Survey&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</description><link>http://ashishmishra16.blogspot.com/2018/05/green-cleaning-its-impacts-on-health.html</link><author>noreply@blogger.com (&lt;b&gt; Ashish Kumar Mishra&lt;/b&gt;  Location:  &lt;b&gt;Pune, India&lt;/b&gt;)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-22938274.post-9139327077037259107</guid><pubDate>Mon, 29 Mar 2010 12:22:00 +0000</pubDate><atom:updated>2010-03-29T18:08:57.809+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">E-commerce</category><category domain="http://www.blogger.com/atom/ns#">What is E-commerce</category><title>So, What is E-commerce?</title><description>The Internet has created a new economic ecosystem, the e-commerce marketplace, and it has become the virtual main street of the world. Providing a quick and convenient way of exchanging goods and services both regionally and globally, e-commerce has boomed. Today, e-commerce has grown into a huge industry with US online retail generating $179 billion in revenues in 2010, with consumer-driven (B2C) online transactions impacting industries from travel services to consumer electronics, from books and media distribution to sports &amp;amp; fitness. So Lets see what is E-commerce:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;E-commerce: &lt;/strong&gt;E-commerce (electronic commerce or EC) is the buying and selling of goods and services on the Internet. In practice, this term and e-business are often used interchangeably. For online retail selling, the term e-tailing is sometimes used.  It has lot of benefits too:&lt;br /&gt;&lt;strong&gt;1. Global Presence&lt;/strong&gt;: The penetration of your business is Global. Means your business can go from India to US, Australia to South Africa.&lt;br /&gt;&lt;strong&gt;2. Less Cost: &lt;/strong&gt;The cost of operations is affordable to anyone. Anyone with a good idea can start and e-commerce business without much investment and can get good returns.&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Many people see e-commerce as some software or some website. These are the aids to perform the business over internet.  For better understanding, you can see this link. &lt;strong&gt;&lt;a href="http://communication.howstuffworks.com/ecommerce.htm/printable"&gt;How E-commerce Works&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;I hope this will help.</description><link>http://ashishmishra16.blogspot.com/2010/03/so-what-is-e-commerce.html</link><author>noreply@blogger.com (&lt;b&gt; Ashish Kumar Mishra&lt;/b&gt;  Location:  &lt;b&gt;Pune, India&lt;/b&gt;)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-22938274.post-8091504506408333458</guid><pubDate>Fri, 07 Nov 2008 12:21:00 +0000</pubDate><atom:updated>2008-11-07T18:03:48.007+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">AWT</category><category domain="http://www.blogger.com/atom/ns#">Screen Shot</category><category domain="http://www.blogger.com/atom/ns#">Screen Shot in Java</category><title>Capturing a Screenshot in Java (Using AWT)</title><description>Taking a screen shot in Java, sounds interesting right. Suddenly, While Searching to internet I came across this.&lt;br /&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;small&gt;&lt;br /&gt;Here is the piece of code with which you can do this task:&lt;br /&gt;&lt;br /&gt;import java.awt.AWTException;&lt;br /&gt;import java.awt.Rectangle;&lt;br /&gt;import java.awt.Robot;&lt;br /&gt;import java.awt.image.BufferedImage;&lt;br /&gt;import java.io.File;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;import javax.imageio.ImageIO;&lt;br /&gt;&lt;br /&gt;public class ScreenCapture {&lt;br /&gt;&lt;br /&gt;&lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;    public static void main(String[] args) {     &lt;br /&gt;&lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;        try {         &lt;br /&gt;          &lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;Robot robot = new Robot();&lt;br /&gt;&lt;br /&gt;&lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;            //The Size of Rectangle is Similar to Screen Resolution.&lt;br /&gt;&lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;            BufferedImage bi=robot.createScreenCapture(new Rectangle(1280,1024));&lt;br /&gt;&lt;br /&gt;&lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;            &lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;//This will write the image to this particular location&lt;br /&gt;&lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;            ImageIO.write(bi, "jpg", new File("C:/Ashish Docs/ScreenShot.jpg"));&lt;br /&gt;&lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;br /&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;        &lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;} catch (AWTException e) {&lt;br /&gt;          &lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;e.printStackTrace();&lt;br /&gt;&lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;        } catch (IOException e) {&lt;br /&gt;          &lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;e.printStackTrace();&lt;br /&gt;&lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;        }catch(Exception ex){&lt;br /&gt;&lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;            &lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;ex.printStackTrace();&lt;br /&gt;&lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;        &lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;}&lt;br /&gt;  &lt;/small&gt;&lt;small&gt;       &lt;/small&gt;&lt;small&gt;}&lt;br /&gt;}&lt;/small&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;&lt;br /&gt;&lt;br /&gt;Don't worry guys the code is working and tested.&lt;/span&gt; Here is the same output of this program:&lt;br /&gt;&lt;br /&gt;&lt;div style="padding: 10px; text-align: left;" class=""&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0FrAuh5AW6fpW3lj1ayXJfhcHz8ewCv8NNqJT7Z9dIsBzkE44l7R__DAXGtUKLsg3wvOV81ZAIHyjeapaj9aVH49VK0tFGjZNA7wtu8Z8j1X2JidZbDIvu5-FsxWvGxr5q72g/s1600-h/Screen.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 374px; height: 298px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0FrAuh5AW6fpW3lj1ayXJfhcHz8ewCv8NNqJT7Z9dIsBzkE44l7R__DAXGtUKLsg3wvOV81ZAIHyjeapaj9aVH49VK0tFGjZNA7wtu8Z8j1X2JidZbDIvu5-FsxWvGxr5q72g/s320/Screen.jpg" alt="" id="BLOGGER_PHOTO_ID_5265890975187961346" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;I hope this will help. Cheers.....&lt;br /&gt;&lt;br /&gt;Ashish Mishra&lt;br /&gt;&lt;br /&gt;"There are some people who live in a Dream World, And There are some who face Reality; And Then there are those who turn One into the Other "&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="technorati-tags"&gt;&lt;a rel="tag" href="http://technorati.com/tag/Screen%20Shot%20in%20Java"&gt;&lt;br /&gt;&lt;/a&gt;&lt;a rel="tag" href="http://technorati.com/tag/AWT"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</description><link>http://ashishmishra16.blogspot.com/2008/11/capturing-screenshot-in-java-using-awt.html</link><author>noreply@blogger.com (&lt;b&gt; Ashish Kumar Mishra&lt;/b&gt;  Location:  &lt;b&gt;Pune, India&lt;/b&gt;)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0FrAuh5AW6fpW3lj1ayXJfhcHz8ewCv8NNqJT7Z9dIsBzkE44l7R__DAXGtUKLsg3wvOV81ZAIHyjeapaj9aVH49VK0tFGjZNA7wtu8Z8j1X2JidZbDIvu5-FsxWvGxr5q72g/s72-c/Screen.jpg" width="72"/><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-22938274.post-7368770229060237635</guid><pubDate>Thu, 16 Oct 2008 12:53:00 +0000</pubDate><atom:updated>2008-10-16T18:29:43.669+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Air and Java</category><category domain="http://www.blogger.com/atom/ns#">Java and Adobe Air</category><category domain="http://www.blogger.com/atom/ns#">Merapi</category><title>Bridging Java and Adobe Air - Merapi</title><description>How Exiciting it will be if you can call Java directly from an AIR Application? I got excited when i read first time. And I feel you will also be. So why to wait, here is the solution for it........ Merapi&lt;br /&gt;Merapi: A Bridge between Adobe AIR and Java&lt;br /&gt;Merapi is a bridge between applications written in Java and those running in and created for Adobe AIR™ (Adobe Integrated Runtime™).&lt;br /&gt;&lt;br /&gt;Merapi has been designed to run on a user's machine, along with an Adobe AIR™application and providea direct bridge between the Adobe AIR™ framework and Java, exposing the power and overall calabilities of the user's operating system, including 3rd party hardware devices.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.merapiproject.net/images/stories/bridge.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px;" src="http://www.merapiproject.net/images/stories/bridge.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;With a light weight and straightforward API, developers can leverage the OS by writing Java companion applications for their AIR™ applications. Java programs treat Merapi as a bridge to the running Adobe AIR™ application and vice-versa. How to achieve this is given below:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Sending a message from ActionScript:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;var message : Message = new Message();&lt;br /&gt;message.data = "Hello from Merapi Flex.";&lt;br /&gt;message.type = "Reply";&lt;br /&gt;Bridge.instance.sendMessage( message );&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Sending a message from Java:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Bridge bridge = Bridge.getInstance();&lt;br /&gt;Message message = new Message();&lt;br /&gt;message.setData("Hello from Merapi Java.");&lt;br /&gt;bridge.sendMessage(message);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Receiving a message in Flex:&lt;/span&gt;&lt;br /&gt;&lt;p style="margin: 0px; font-family: Courier; font-style: normal; font-variant: normal; font-weight: normal; font-size: 16px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="letter-spacing: 0px;"&gt;&lt;&lt;small&gt;merapi:BridgeInstance&lt;/small&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin: 0px; font-family: Courier; font-style: normal; font-variant: normal; font-weight: normal; font-size: 16px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;small&gt;id="bridge" &lt;span style="letter-spacing: 0px;"&gt;result="handleResult(event)" &lt;/span&gt;/&gt;&lt;/small&gt;&lt;/p&gt;&lt;br /&gt;in Script:&lt;br /&gt;  &lt;p style="margin: 0px; font-family: Courier; font-style: normal; font-variant: normal; font-weight: normal; font-size: 16px; line-height: normal; font-size-adjust: none; font-stretch: normal; letter-spacing: 0px;"&gt;&lt;small&gt;&lt;span style="letter-spacing: 0px;"&gt; &lt;/span&gt;&lt;strong&gt;private&lt;/strong&gt;&lt;span style="letter-spacing: 0px;"&gt; &lt;/span&gt;&lt;strong&gt;function&lt;/strong&gt;&lt;span style="letter-spacing: 0px;"&gt; handleResult( event : ResultEvent ) : &lt;/span&gt;&lt;strong&gt;void&lt;/strong&gt;{&lt;/small&gt;&lt;/p&gt;   &lt;p style="margin: 0px; font-family: Courier; font-style: normal; font-variant: normal; font-weight: normal; font-size: 16px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;small&gt;&lt;span style="letter-spacing: 0px;"&gt;    &lt;/span&gt;&lt;strong&gt;var&lt;/strong&gt;&lt;span style="letter-spacing: 0px;"&gt; message : IMessage = event.result &lt;/span&gt;&lt;strong&gt;as&lt;/strong&gt;&lt;span style="letter-spacing: 0px;"&gt; IMessage;&lt;/span&gt;&lt;/small&gt;&lt;/p&gt; &lt;div&gt;&lt;small&gt;&lt;span style="font-family: Courier; font-size: 16px;"&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/small&gt;&lt;span style="font-weight: bold;"&gt;Receiving a message in Java:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;p style="margin: 0px; font-family: Courier; font-style: normal; font-variant: normal; font-weight: normal; font-size: 16px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;small&gt;&lt;span style="letter-spacing: 0px;"&gt;Bridge.&lt;em&gt;getInstance&lt;/em&gt;().registerMessageHandler(&lt;/span&gt;"Reply"&lt;span style="letter-spacing: 0px;"&gt;, messageHandlerInstance );&lt;/span&gt;&lt;/small&gt;&lt;/p&gt;      &lt;p style="margin: 0px; font-family: Courier; font-style: normal; font-variant: normal; font-weight: normal; font-size: 16px; line-height: normal; font-size-adjust: none; font-stretch: normal; letter-spacing: 0px;"&gt;&lt;small&gt;&lt;strong&gt;public&lt;/strong&gt;&lt;span style="letter-spacing: 0px;"&gt; &lt;/span&gt;&lt;strong&gt;void&lt;/strong&gt;&lt;span style="letter-spacing: 0px;"&gt; handleMessage( IMessage message )&lt;/span&gt;{&lt;/small&gt;&lt;/p&gt;   &lt;p style="margin: 0px; font-family: Courier; font-style: normal; font-variant: normal; font-weight: normal; font-size: 16px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;small&gt;&lt;span style="letter-spacing: 0px;"&gt;System.&lt;/span&gt;&lt;em&gt;out&lt;/em&gt;&lt;span style="letter-spacing: 0px;"&gt;.println( message.getData() );&lt;/span&gt;&lt;/small&gt;&lt;/p&gt;   &lt;p style="margin: 0px; font-family: Courier; font-style: normal; font-variant: normal; font-weight: normal; font-size: 16px; line-height: normal; font-size-adjust: none; font-stretch: normal; letter-spacing: 0px;"&gt;&lt;small&gt;     }&lt;/small&gt;&lt;/p&gt; &lt;strong&gt;&lt;small&gt; &lt;/small&gt;&lt;/strong&gt;&lt;p style="margin: 0px; font-family: Courier; font-style: normal; font-variant: normal; font-weight: normal; font-size: 16px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 19px;"&gt;&lt;strong&gt;&lt;small&gt; &lt;/small&gt;&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;small&gt;&lt;span style="font-family: Courier; font-size: 16px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/small&gt;&lt;/div&gt;&lt;br /&gt;&lt;merapi:bridgeinstance id="bridge" result="handleResult(event)"&gt;&lt;mx:script&gt;&lt;br /&gt;&lt;!--[CDATA[&lt;br /&gt;&lt;br /&gt;private function handleResult( event : ResultEvent ) : void&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;var message : IMessage = event.result as IMessage;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Receiving a message in Java:&lt;br /&gt;&lt;br /&gt;Bridge.getInstance().registerMessageHandler("Reply", messageHandlerInstance );&lt;br /&gt;&lt;br /&gt;public void handleMessage( IMessage message )&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;System.out.println( message.getData() );&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt; --&gt;&lt;/mx:script&gt;&lt;/merapi:bridgeinstance&gt;</description><link>http://ashishmishra16.blogspot.com/2008/10/bridging-java-and-adobe-air-merapi.html</link><author>noreply@blogger.com (&lt;b&gt; Ashish Kumar Mishra&lt;/b&gt;  Location:  &lt;b&gt;Pune, India&lt;/b&gt;)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-22938274.post-5796539157324446988</guid><pubDate>Fri, 25 Jul 2008 11:36:00 +0000</pubDate><atom:updated>2008-07-25T17:08:17.871+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">JavaScript</category><title>Finding Postions of HTML Element in a Scrollable Div</title><description>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Hi Friends,&lt;br/&gt;&lt;br/&gt;Have you ever find it difficult to find the x, y coordinates value for a HTML element in side a scrollable div. Just few days back, i got this problem. where i wanted to show tool tip on a link, but since the HTML element was in a scrollable div, the positioning to tooltip was not correct. Here is the code earlier i used to find the X and Y positions:&lt;br/&gt;&lt;br/&gt;function findPosX(obj)&lt;br/&gt;{&lt;br/&gt;    var curleft = 0;&lt;br/&gt;    if (obj.offsetParent)&lt;br/&gt;    {&lt;br/&gt;        while (obj.offsetParent)&lt;br/&gt;        {&lt;br/&gt;            curleft += obj.offsetLeft&lt;br/&gt;            obj = obj.offsetParent;&lt;br/&gt;        }&lt;br/&gt;    }&lt;br/&gt;    else if (obj.x)&lt;br/&gt;        curleft += obj.x;&lt;br/&gt;    return curleft;&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;function findPosY(obj)&lt;br/&gt;{&lt;br/&gt;    var curtop = 0;&lt;br/&gt;    if (obj.offsetParent)&lt;br/&gt;    {&lt;br/&gt;        while (obj.offsetParent)&lt;br/&gt;        {&lt;br/&gt;            curtop += obj.offsetTop&lt;br/&gt;            obj = obj.offsetParent;&lt;br/&gt;        }&lt;br/&gt;    }&lt;br/&gt;    else if (obj.y)&lt;br/&gt;        curtop += obj.y;&lt;br/&gt;    return curtop;&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;This function works well when your HTML element is not within a scrollable div. But what if it is present inside a scrollable div? So here is the solutions. I found that we are using prototype.js. Which has a Element called Position. This helps to find out the actual pixel value for X and Y coordinate. Here is code how to calculate is:&lt;br/&gt;&lt;br/&gt;        var iebody = (document.compatMode &amp;amp;&amp;amp; document.compatMode != "BackCompat")? document.documentElement : document.body;&lt;br/&gt;&lt;br/&gt;        var dsocleft = document.all? iebody.scrollLeft : pageXOffset;&lt;br/&gt;        var dsoctop = document.all? iebody.scrollTop : pageYOffset;&lt;br/&gt;&lt;br/&gt;        var posReal = Position.realOffset(obj); &lt;br/&gt;        //Position is a readymade object in prototype.js&lt;br/&gt;        var pos = Position.cumulativeOffset(obj);&lt;br/&gt;&lt;br/&gt;        var top =  pos[1] - posReal[1] + dsoctop;&lt;br/&gt;        //value of Y&lt;br/&gt;        var left = pos[0] + posReal[1] - dsocleft;&lt;br/&gt;       //value of X&lt;br/&gt;&lt;br/&gt;In this way, you can find the accurate pixel value of X and Y coordinates. I hope this will help you all.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Technorati Tags: &lt;a rel='tag' href='http://technorati.com/tag/Positions%20in%20Scrollable%20Div' class='performancingtags'&gt;Positions in Scrollable Div&lt;/a&gt;, &lt;a rel='tag' href='http://technorati.com/tag/JavaScript' class='performancingtags'&gt;JavaScript&lt;/a&gt;, &lt;a rel='tag' href='http://technorati.com/tag/Prototype.js' class='performancingtags'&gt;Prototype.js&lt;/a&gt;, &lt;a rel='tag' href='http://technorati.com/tag/' class='performancingtags'/&gt;&lt;/div&gt;</description><link>http://ashishmishra16.blogspot.com/2008/07/finding-postions-of-html-element-in_25.html</link><author>noreply@blogger.com (&lt;b&gt; Ashish Kumar Mishra&lt;/b&gt;  Location:  &lt;b&gt;Pune, India&lt;/b&gt;)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-22938274.post-1780417052752718119</guid><pubDate>Thu, 05 Jun 2008 12:45:00 +0000</pubDate><atom:updated>2008-06-05T18:38:57.901+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">List</category><category domain="http://www.blogger.com/atom/ns#">Removing Element from List</category><title>Removing null or specific values from list in Java</title><description>Have you tried to remove &lt;b style=""&gt;null&lt;/b&gt; values from a List (may a ArrayList). Yesterday I was trying it out, when I had to remove &lt;b style=""&gt;null&lt;/b&gt; values from a List before processing it.  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Initially, I was trying with the simple &lt;b style=""&gt;&lt;span style=""&gt; &lt;/span&gt;for loop &lt;/b&gt;and out I was getting Still NullPointerException while processing. I tried with couple of ways, before I came to a efficient one. Lets see this with an example:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Lets see what are the flaws, when u try to remove null values from a List with a &lt;span style="font-weight: bold;"&gt;for &lt;/span&gt;loop:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-style: italic;" class="MsoNormal"&gt;List li = new ArrayList();&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-style: italic;" class="MsoNormal"&gt;FileListItem fLI = new FileListItem();&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-style: italic;" class="MsoNormal"&gt;fLI.setFormFileName("123");&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-style: italic;" class="MsoNormal"&gt;FileListItem fLI2 = new FileListItem();&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-style: italic;" class="MsoNormal"&gt;FileListItem fLI3 = new FileListItem();&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-style: italic;" class="MsoNormal"&gt;FileListItem fLI4 = new FileListItem();&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-style: italic;" class="MsoNormal"&gt;fLI4.setFormFileName("456");&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-style: italic;" class="MsoNormal"&gt;li.add(fLI);&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-style: italic;" class="MsoNormal"&gt;li.add(fLI2);&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-style: italic;" class="MsoNormal"&gt;li.add(fLI3);&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-style: italic;" class="MsoNormal"&gt;li.add(fLI4);&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-style: italic;" class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-style: italic;" class="MsoNormal"&gt;System.out.println("====this.fileList() =====" + li);&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-style: italic;" class="MsoNormal"&gt;for(int i = 0;i &lt;&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in; font-style: italic;"&gt;System.out.println("li Size ====" + li.size() + "&lt;span style=""&gt;     &lt;/span&gt;&amp;amp; Value of i ===== "+i);&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-style: italic;" class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;FileListItem fileListItem = (FileListItem) li.get(i);&lt;span style=""&gt;            &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-style: italic;" class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;System.out.println("fileListItem is ====== "+fileListItem);&lt;span style=""&gt;         &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-style: italic;" class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;if(null == fileListItem.getFormFileName())&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-style: italic;" class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;li.remove(i);&lt;span style=""&gt;        &lt;/span&gt;&lt;span style=""&gt;      &lt;/span&gt;&lt;/p&gt;  &lt;p style="font-style: italic;" class="MsoNormal"&gt;}&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-style: italic;"&gt;System.out.println("====this.fileList() =====" + li);&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What output it will produce, Lets see &lt;/p&gt;  &lt;p class="MsoNormal"&gt;=== this.fileList()==[FileListItem{ formFileName=123}, FileListItem{ formFileName=null}, FileListItem{ formFileName=null}, FileListItem{ formFileName=456}]&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;li Size ====4&lt;span style=""&gt;     &lt;/span&gt;&amp;amp; Value of i ===== 0&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;fileListItem is ====== FileListItem{ formFileName=123}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;li Size ====4&lt;span style=""&gt;     &lt;/span&gt;&amp;amp; Value of i ===== 1&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;fileListItem is ====== FileListItem{ formFileName=null}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;li Size ====3&lt;span style=""&gt;     &lt;/span&gt;&amp;amp; Value of i ===== 2&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;fileListItem is ====== FileListItem{ formFileName=456}&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;=== this.fileList()== [FileListItem{ formFileName=123}, FileListItem{ formFileName=null}, FileListItem{ formFileName=456}]&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;Here it still contains a Null Value in it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;So what is the efficient way to remove elements from a list:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Iterator is wonderful thing to handle it. Lets see the same thing with Iterator.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-style: italic;" class="MsoNormal"&gt;System.out.println("====this.fileList() =====" + li);&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-style: italic;" class="MsoNormal"&gt;Iterator itr = li.iterator();&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-style: italic;" class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;while(itr.hasNext()){&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-style: italic;" class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;FileListItem fileListItem = (FileListItem) itr.next();&lt;span style=""&gt;        &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-style: italic;" class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;if(null == fileListItem.getFormFileName())&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-style: italic;" class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;itr.remove();&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-style: italic;" class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;}&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-style: italic;"&gt;System.out.println("====this.fileList() =====" + li);&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Here the Output will be :&lt;/p&gt;  &lt;p class="MsoNormal"&gt;====this.fileList() ===== [FileListItem{ formFileName=123}, FileListItem{ formFileName=null}, FileListItem{ formFileName=null}, FileListItem{ formFileName=456}]&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;====this.fileList() ===== [FileListItem{ formFileName=123}, FileListItem{ formFileName=456}]&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;ListIterator can also be used for the same, but ListIterator give you additional advantage of adding elements to a list, while iterating it.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Please download the complete code from here: &lt;a href="http://www.esnips.com/doc/0e20328b-cabf-466c-8e85-b758b14ff935/ListDemo" target="_blank"&gt;&lt;b style=""&gt;ListDemoCode&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;</description><link>http://ashishmishra16.blogspot.com/2008/06/removing-null-or-specific-values-from.html</link><author>noreply@blogger.com (&lt;b&gt; Ashish Kumar Mishra&lt;/b&gt;  Location:  &lt;b&gt;Pune, India&lt;/b&gt;)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-22938274.post-3656541579634883074</guid><pubDate>Wed, 26 Mar 2008 12:43:00 +0000</pubDate><atom:updated>2008-03-26T18:33:11.343+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Ashish's Holi</category><category domain="http://www.blogger.com/atom/ns#">Holi</category><category domain="http://www.blogger.com/atom/ns#">Holi 2008</category><title>Holi 2008 - Better than Expected</title><description>Hi Friends,&lt;br /&gt;&lt;br /&gt;This time I celebrated holi in Pune. This year it was special. Check out the photos, which will tell you about it.&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjD9KXhBi4zCksVNqkkWECShdxLlwdtLVO_6lFO5Jyxhs4J50h5jR7XyImXBwixESKfvww6ug2ci46pRpB31x6gDCynbz9dYMviOHHkAkK9q98f9x2VPhCX4n9U5bQEwKo9OrCI/s1600-h/IMG_2263.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjD9KXhBi4zCksVNqkkWECShdxLlwdtLVO_6lFO5Jyxhs4J50h5jR7XyImXBwixESKfvww6ug2ci46pRpB31x6gDCynbz9dYMviOHHkAkK9q98f9x2VPhCX4n9U5bQEwKo9OrCI/s320/IMG_2263.jpg" alt="" id="BLOGGER_PHOTO_ID_5182031371763673618" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwbxzvDcKn7iYh-B5hBEFBJH0thzKxthpbLWn85dEI2HIn_7FPTJXPUVKeUFkDnskznD5REZuHPQ3IT7JJqZFBnjbTCx9YAeT6gpPz05Fzgl6inbkgiWeek7J6B0rMQ0xz9ewQ/s1600-h/IMG_2297.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwbxzvDcKn7iYh-B5hBEFBJH0thzKxthpbLWn85dEI2HIn_7FPTJXPUVKeUFkDnskznD5REZuHPQ3IT7JJqZFBnjbTCx9YAeT6gpPz05Fzgl6inbkgiWeek7J6B0rMQ0xz9ewQ/s320/IMG_2297.jpg" alt="" id="BLOGGER_PHOTO_ID_5182031874274847266" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBh2k0C4viv_PizSoak78T9di1QV6cc4KxjiuUMYbyJQKEEr5vtM6IIUlSH4hQxZfpDwXbZ6rrVr6K-RmP9DR18MM0e128edbvK6gFdSzloOicOl8URIEpAPCR9gkU7X3phpjc/s1600-h/IMG_2255.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBh2k0C4viv_PizSoak78T9di1QV6cc4KxjiuUMYbyJQKEEr5vtM6IIUlSH4hQxZfpDwXbZ6rrVr6K-RmP9DR18MM0e128edbvK6gFdSzloOicOl8URIEpAPCR9gkU7X3phpjc/s320/IMG_2255.jpg" alt="" id="BLOGGER_PHOTO_ID_5182032488455170610" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVIxBJfzuqHODtSr01GJBCN3k4f1zAtmBQyDD92qtH8_QaOLC-KivaSGnd75oyGRGTlPM_NJhWql5hy1QYO4In8B2M5pdRBlXqcZjbUz-UDnwyBCODr333keeV8KvPrhtQbuJK/s1600-h/Savalia000.jpg"&gt;&lt;img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVIxBJfzuqHODtSr01GJBCN3k4f1zAtmBQyDD92qtH8_QaOLC-KivaSGnd75oyGRGTlPM_NJhWql5hy1QYO4In8B2M5pdRBlXqcZjbUz-UDnwyBCODr333keeV8KvPrhtQbuJK/s320/Savalia000.jpg" alt="" id="BLOGGER_PHOTO_ID_5182032948016671298" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOJ1tYqoJdLcvZNT2e23_tjiGn96RrKfq9H3KIGqhKcAWBJYiuGjjVCR1L9MoBgggOYOAf_W6AcuRCCyP0H6obQdpXihyphenhyphensO5ASHZuiJeu4bHZUjX7SSTDn84UKrOVD3jDXDT6n/s1600-h/Savalia014.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOJ1tYqoJdLcvZNT2e23_tjiGn96RrKfq9H3KIGqhKcAWBJYiuGjjVCR1L9MoBgggOYOAf_W6AcuRCCyP0H6obQdpXihyphenhyphensO5ASHZuiJeu4bHZUjX7SSTDn84UKrOVD3jDXDT6n/s320/Savalia014.jpg" alt="" id="BLOGGER_PHOTO_ID_5182033300203989586" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5cT14Pe4z-S-aullNHtYf32XIzZhvXTJGnNswW1_m-sXzo0ts9qexF8THLM5tm9GxDScgDz9DCJR436wi_dop6BKRyuKA8yYrPm5tut4O6GVxZzIpsukz3F-u5IkmT-u1ushn/s1600-h/Savalia017.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5cT14Pe4z-S-aullNHtYf32XIzZhvXTJGnNswW1_m-sXzo0ts9qexF8THLM5tm9GxDScgDz9DCJR436wi_dop6BKRyuKA8yYrPm5tut4O6GVxZzIpsukz3F-u5IkmT-u1ushn/s320/Savalia017.jpg" alt="" id="BLOGGER_PHOTO_ID_5182033502067452514" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuydgO8hm6iI505Gcs-7z-7xMA4NPq-EH_qkp5FtEYS_cSEyJvrhPw05iIISpkbR-8QhxFcwib34ltSp9mhfjL7Ci8U3uXA-WafC9HjRyvqKR91R5oyslgQbUdlKKaD4KzDYI_/s1600-h/Savalia019.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuydgO8hm6iI505Gcs-7z-7xMA4NPq-EH_qkp5FtEYS_cSEyJvrhPw05iIISpkbR-8QhxFcwib34ltSp9mhfjL7Ci8U3uXA-WafC9HjRyvqKR91R5oyslgQbUdlKKaD4KzDYI_/s320/Savalia019.jpg" alt="" id="BLOGGER_PHOTO_ID_5182033691046013554" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuydgO8hm6iI505Gcs-7z-7xMA4NPq-EH_qkp5FtEYS_cSEyJvrhPw05iIISpkbR-8QhxFcwib34ltSp9mhfjL7Ci8U3uXA-WafC9HjRyvqKR91R5oyslgQbUdlKKaD4KzDYI_/s1600-h/Savalia019.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuydgO8hm6iI505Gcs-7z-7xMA4NPq-EH_qkp5FtEYS_cSEyJvrhPw05iIISpkbR-8QhxFcwib34ltSp9mhfjL7Ci8U3uXA-WafC9HjRyvqKR91R5oyslgQbUdlKKaD4KzDYI_/s320/Savalia019.jpg" alt="" id="BLOGGER_PHOTO_ID_5182033691046013554" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Thanks My frens, who were there with Me. I hope Everybody had a great fun on that day.</description><link>http://ashishmishra16.blogspot.com/2008/03/holi-2008-better-than-expected.html</link><author>noreply@blogger.com (&lt;b&gt; Ashish Kumar Mishra&lt;/b&gt;  Location:  &lt;b&gt;Pune, India&lt;/b&gt;)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjD9KXhBi4zCksVNqkkWECShdxLlwdtLVO_6lFO5Jyxhs4J50h5jR7XyImXBwixESKfvww6ug2ci46pRpB31x6gDCynbz9dYMviOHHkAkK9q98f9x2VPhCX4n9U5bQEwKo9OrCI/s72-c/IMG_2263.jpg" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-22938274.post-7334906286186043509</guid><pubDate>Fri, 14 Mar 2008 09:46:00 +0000</pubDate><atom:updated>2008-03-14T15:53:51.057+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">About Ashish</category><category domain="http://www.blogger.com/atom/ns#">Ashish Kumar Mishra</category><title>Its nothing but All about me.</title><description>Hi Friends,&lt;br /&gt;&lt;br /&gt;I am Ashish Kumar Mishra. I am an Indian. I born an brought up in Hisar, a district of Haryana.  I did my schooling from Hisar. But Schools keep changing after every year or 2. I did my Matriculation, From Leading High School.  And Intermediate from New Yashoda Public School. Then I joined degree program from Maharshi Dayanand University in Computer Applications. In my school days (Before Matriculation), I decided that i am going for a  Degree in Computers and I thought a Degree in Computer Applications was a better option.&lt;br /&gt;&lt;br /&gt;After my graduation, I went to Delhi, started preparing for the Entrance of Post Graduation in Computer Application. I joined a Company in Delhi as Trainee Programmer. But my father wanted me to go for Higher Educations. Even I wanted to go for it.  And I took admission in my Post Graduation Programme in Computer Application offered by Amravati University. I passed my Post Graduation in 2007. But in 5th Semester, I joined a Company called Vision System Group in Hyderabad. My previous  experience was helping me to grow up as a Computer Professional. I was not as novice as my other colleagues joined with me.   I was working on Java Technology, where i wanted to work.&lt;br /&gt;&lt;br /&gt;Each day was a new learning. I was enjoying  my each day on work.  I completed my 1 year there. Then something unwanted happened. The company was going to Split.&lt;br /&gt;&lt;br /&gt;It was time to search for another opportunity. And I Joined &lt;a href="http://www.quinstreet.com"&gt;QuinStreet &lt;/a&gt;in the Month&lt;br /&gt;of January 2008. And Again I am working on Java technology Here. &lt;br /&gt;&lt;br /&gt;In QuinStreet, it just few days, but i feel i have been working here from many year. Colleagues becomes friends.  Working here is  more fun here. &lt;br /&gt;&lt;br /&gt;This is all about me- Ashish Kumar Mishra.</description><link>http://ashishmishra16.blogspot.com/2008/03/its-nothing-but-all-about-me.html</link><author>noreply@blogger.com (&lt;b&gt; Ashish Kumar Mishra&lt;/b&gt;  Location:  &lt;b&gt;Pune, India&lt;/b&gt;)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-22938274.post-5596983060845433884</guid><pubDate>Thu, 17 Jan 2008 10:02:00 +0000</pubDate><atom:updated>2008-01-17T16:00:08.740+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Important Acquistion</category><category domain="http://www.blogger.com/atom/ns#">MySQL Merger</category><category domain="http://www.blogger.com/atom/ns#">Sun</category><title>Sun To acquire MySQL</title><description>Sun Microsystems is going to jump in the database market with the purchase of most successful open source database developer MySQL for $1 billion.  This is the main center of attraction on both the websites:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXBuRqeJG_p61epzZxnE_XCSnQZw3VJhMY5i4hQmCptJE9TBIXKkpbjHXSmhps6FG-wgZEix1yChfxdRezOvAkn7h3_bvtnQtHc3Z7xc6sc6jWCutOT_n4LgbR-lZqAdbySxVv/s1600-h/SunToAcquire.JPG"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: left; cursor: pointer; width: 320px; height: 264px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXBuRqeJG_p61epzZxnE_XCSnQZw3VJhMY5i4hQmCptJE9TBIXKkpbjHXSmhps6FG-wgZEix1yChfxdRezOvAkn7h3_bvtnQtHc3Z7xc6sc6jWCutOT_n4LgbR-lZqAdbySxVv/s320/SunToAcquire.JPG" alt="" id="BLOGGER_PHOTO_ID_5156385921211795170" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&amp;amp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvOG3ECsfmdyr4PKelcv50Cy-DiRjN0n_Sb3lEYNE1bwRLe0inNrm9gNGQYgcvjSmBlN4pFiWTPhMUuTv2yImkhd_6DvJgM9mKHkVjxTIytydNjtD-ZJiAb9ulxipK6obMj5y5/s1600-h/MSQL.JPG"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: left; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvOG3ECsfmdyr4PKelcv50Cy-DiRjN0n_Sb3lEYNE1bwRLe0inNrm9gNGQYgcvjSmBlN4pFiWTPhMUuTv2yImkhd_6DvJgM9mKHkVjxTIytydNjtD-ZJiAb9ulxipK6obMj5y5/s320/MSQL.JPG" alt="" id="BLOGGER_PHOTO_ID_5156387020723422962" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;With the move, announced Wednesday, Sun takes a big leap into the $15 billion database market and pits it against the likes of Microsoft, IBM and Oracle. MySQL have clients Facebook, Google, Nokia and Baidu as customers.&lt;br /&gt;&lt;br /&gt;What makes MySQL interesting to Sun. About 20 percent of MySQL deployments run on Solaris, according to Sun estimates outlined on a conference call. Seventy five percent of MySQL deployments are not on Sun hardware. That gives Sun an opportunity to bundle hardware software and services.&lt;br /&gt;&lt;br /&gt;While Sun can also distribute MySQL through its channel and OEM partnerships and create various bundles. The overarching goal is to give MySQL more “commercial appeal” and boost adoption of open source software in the enterprise.&lt;br /&gt;&lt;p&gt;One big question is what Sun does next to build out its stack of open source software and other applications covering middleware, storage and virtualization. Sun’s software lineup now includes Java, MySQL, OpenSolaris and GlassFish.&lt;/p&gt;&lt;p&gt;Sun plans to integrate MySQL into its software, sales and service groups and MySQL CEO Marten Mickos will stay after the acquisition.&lt;/p&gt;Now many questions are evolving out in the IT market. Like&lt;br /&gt;&lt;br /&gt;Is it a deal against the Microsoft to fight with Sql Server ?&lt;br /&gt;&lt;strong style="font-weight: normal;"&gt;How will MySQL community handle being part of Sun ?&lt;br /&gt;Is it a beneficial to MySql future or it may loose its shine among Open Source world?&lt;br /&gt;&lt;br /&gt;In near future we may expect a better J2EE Stack bundled with a better database in it.  But definitely MySQL CEO, &lt;/strong&gt;&lt;em style="font-weight: bold;"&gt;Marten Mickos&lt;/em&gt;&lt;strong style="font-weight: normal;"&gt;,  will be in cloud Nine at this time with this deal.&lt;br /&gt;&lt;/strong&gt;</description><link>http://ashishmishra16.blogspot.com/2008/01/sun-to-acquire-mysql.html</link><author>noreply@blogger.com (&lt;b&gt; Ashish Kumar Mishra&lt;/b&gt;  Location:  &lt;b&gt;Pune, India&lt;/b&gt;)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXBuRqeJG_p61epzZxnE_XCSnQZw3VJhMY5i4hQmCptJE9TBIXKkpbjHXSmhps6FG-wgZEix1yChfxdRezOvAkn7h3_bvtnQtHc3Z7xc6sc6jWCutOT_n4LgbR-lZqAdbySxVv/s72-c/SunToAcquire.JPG" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-22938274.post-7363150823299899853</guid><pubDate>Thu, 03 Jan 2008 05:53:00 +0000</pubDate><atom:updated>2008-01-03T11:46:51.953+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Exception Handling</category><category domain="http://www.blogger.com/atom/ns#">Java Exception Handling</category><title>Three Rules for Effective Exception Handling</title><description>Exceptions in Java provide a consistent mechanism for identifying and responding to error conditions. Effective exception handling will make your programs more robust and easier to debug. Exceptions are a tremendous debugging aid because they help answer these three questions:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;• What went wrong?&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;&lt;br /&gt;• Where did it go wrong?&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;&lt;br /&gt;• Why did it go wrong?&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;When exceptions are used effectively, what is answered by the type of exception thrown, where is answered by the exception stack trace, and why is answered by the exception message. If you find your exceptions aren't answering all three questions, chances are they aren't being used effectively. Three rules will help you make the best use of exceptions when debugging your programs.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;These rules are: be specific, throw early, and catch late.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To illustrate these rules of effective exception handling, this article discusses a fictional personal finance manager called JCheckbook. JCheckbook can be used to record and track bank account activity, such as deposits, withdrawals, and checks written. The initial version of JCheckbook runs as a desktop application, but future plans call for an HTML client and a client/server applet implementation.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1. Be Specific&lt;/span&gt;&lt;br /&gt;Java defines an exception class hierarchy, starting with Throwable, which is extended by Error and Exception, which is then extended by RuntimeException. These are illustrated in Figure 1.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHDH716Zjog6p_-_TrvCP07b0Z7IofZhvs0TCC6n9NusTiEow6XpoHx3tKc4FLGvIY4LxyDp_UrKX3jyft3FLmd5lVa3v_h7A-iyjjEu5jokJBR7O7P20kVw0luAjBqnAmGvKf/s1600-h/exception.gif"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHDH716Zjog6p_-_TrvCP07b0Z7IofZhvs0TCC6n9NusTiEow6XpoHx3tKc4FLGvIY4LxyDp_UrKX3jyft3FLmd5lVa3v_h7A-iyjjEu5jokJBR7O7P20kVw0luAjBqnAmGvKf/s320/exception.gif" alt="" id="BLOGGER_PHOTO_ID_5151129134644561618" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Figure 1. Java exception hierarchy&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;These four classes are generic and they don't provide much information about what went wrong. While it is legal to instantiate any of these classes (e.g., new Throwable()), it is best to think of them as abstract base classes, and work with more specific subclasses. Java provides a substantial number of exception subclasses, and you may define your own exception classes for additional specificity.&lt;br /&gt;&lt;br /&gt;For example, the java.io package defines the IOException subclass, which extends Exception. Even more specific are FileNotFoundException, EOFException, and ObjectStreamException, all subclasses of IOException. Each one describes a particular type of I/O-related failure: a missing file, an unexpected end-of-file, or a corrupted serialized object stream, respectively. The more specific the exception, the better our program answers what went wrong.&lt;br /&gt;&lt;br /&gt;It is important to be specific when catching exceptions, as well. For example, JCheckbook may respond to a FileNotFoundException by asking the user for a different file name. In the case of an EOFException, it may be able to continue with just the information it was able to read before the exception was thrown. If an ObjectStreamException is thrown, the program may need to inform the user that the file has been corrupted, and that a backup or a different file needs to be used.&lt;br /&gt;&lt;br /&gt;Java makes it fairly easy to be specific when catching exceptions because we can specify multiple catch blocks for a single try block, each handling a different type of exception in an appropriate manner.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;File prefsFile = new File(prefsFilename);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;try&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; readPreferences(prefsFile);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;catch (FileNotFoundException e)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; // alert the user that the specified file&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; // does not exist&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;catch (EOFException e)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; // alert the user that the end of the file&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; // was reached&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;catch (ObjectStreamException e)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; // alert the user that the file is corrupted&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;catch (IOException e)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; // alert the user that some other I/O&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; // error occurred&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;JCheckbook uses multiple catch blocks in order to provide the user with specific information about the type of exception that was caught. For instance, if a FileNotFoundException was caught, it can instruct the user to specify a different file. The extra coding effort of multiple catch blocks may be an unnecessary burden in some cases, but in this example, it does help the program respond in a more user-friendly manner.&lt;br /&gt;&lt;br /&gt;Should an IOException other than those specified by the first three catch blocks be thrown, the last catch block will handle it by presenting the user with a somewhat more generic error message. This way, the program can provide specific information when possible, but still handle the general case should an unanticipated file-related exception "slip by."&lt;br /&gt;&lt;br /&gt;Sometimes, developers will catch a generic Exception and then display the exception class name or stack trace, in order to "be specific." Don't do this. Seeing java.io.EOFException or a stack trace printed to the screen is likely to confuse, rather than help, the user. Catch specific exceptions and provide the user with specific information in English (or some other human language). Do, however, include the exception stack trace in your log file. Exceptions and stack traces are meant as an aid to the developer, not to the end user.&lt;br /&gt;&lt;br /&gt;Finally, notice that instead of catching the exception in the readPreferences() method, JCheckbook defers catching and handling the exception until it reaches the user interface level, where it can alert the user with a dialog box or in some other fashion. This is what is meant by "catch late," as will be discussed later in this article.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2. Throw Early&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The exception stack trace helps pinpoint where an exception occurred by showing us the exact sequence of method calls that lead to the exception, along with the class name, method name, source code filename, and line number for each of these method calls. Consider the stack trace below:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;java.lang.NullPointerException&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; at java.io.FileInputStream.open(Native Method)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; at java.io.FileInputStream.&lt;/span&gt;&lt;init&gt;&lt;span style="font-style: italic;"&gt;(FileInputStream.java:103)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; at jcheckbook.JCheckbook.readPreferences(JCheckbook.java:225)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; at jcheckbook.JCheckbook.startup(JCheckbook.java:116)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; at jcheckbook.JCheckbook.&lt;/span&gt;&lt;init&gt;&lt;span style="font-style: italic;"&gt;(JCheckbook.java:27)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; at jcheckbook.JCheckbook.main(JCheckbook.java:318)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This shows that the open() method of the FileInputStream class threw a NullPointerException. But notice that FileInputStream.close() is part of the standard Java class library. It is much more likely that the problem that is causing the exception to be thrown is within our own code, rather than the Java API. So the problem must have occurred in one of the preceding methods, which fortunately are also displayed in the stack trace.&lt;br /&gt;&lt;br /&gt;What is not so fortunate is that NullPointerException is one of the least informative (and most frequently encountered and frustrating) exceptions in Java. It doesn't tell us what we really want to know: exactly what is null. Also, we have to backtrack a few steps to find out where the error originated.&lt;br /&gt;&lt;br /&gt;By stepping backwards through the stack trace and investigating our code, we determine that the error was caused by passing a null filename parameter to the readPreferences() method. Since readPreferences() knows it cannot proceed with a null filename, it checks for this condition immediately:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;public void readPreferences(String filename)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; throws IllegalArgumentException&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; if (filename == null)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;     throw new IllegalArgumentException&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                         ("filename is null");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; }  //if&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; //...perform other operations...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; InputStream in = new FileInputStream(filename);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; //...read the preferences file...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;By throwing an exception early (also known as "failing fast"), the exception becomes both more specific and more accurate. The stack trace immediately shows what went wrong (an illegal argument value was supplied), why this is an error (null is not allowed for filename), and where the error occurred (early in the readPreferences() method). This keeps our stack trace honest:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;java.lang.IllegalArgumentException: filename is null&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; at jcheckbook.JCheckbook.readPreferences(JCheckbook.java:207)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; at jcheckbook.JCheckbook.startup(JCheckbook.java:116)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; at jcheckbook.JCheckbook.&lt;/span&gt;&lt;init&gt;&lt;span style="font-style: italic;"&gt;(JCheckbook.java:27)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; at jcheckbook.JCheckbook.main(JCheckbook.java:318)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;In addition, the inclusion of an exception message ("filename is null") makes the exception more informative by answering specifically what was null, an answer we don't get from the NullPointerException thrown by the earlier version of our code.&lt;br /&gt;&lt;br /&gt;Failing fast by throwing exceptions as soon as an error is detected can eliminate the need to construct objects or open resources, such as files or network connections, that won't be needed. The clean-up effort associated with opening these resources is also eliminated.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;3. Catch Late&lt;br /&gt;&lt;/span&gt;A common mistake of many Java developers, both new and experienced, is to catch an exception before the program can handle it in an appropriate manner. The Java compiler reinforces this behavior by insisting that checked exceptions either be caught or declared. The natural tendency is to immediately wrap the code in a try block and catch the exception to stop the compile from reporting errors.&lt;br /&gt;&lt;br /&gt;The question is, what to do with an exception after it is caught? The absolute worst thing to do is nothing. An empty catch block swallows the exception, and all information about what, where, and why something went wrong is lost forever. Logging the exception is slightly better, since there is at least a record of the exception. But we can hardly expect that the user will read or even understand the log file and stack trace. It is not appropriate for readPreferences() to display a dialog with an error message, because while JCheckbook currently runs as a desktop application, we also plan to make it an HTML-based web application. In that case, displaying an error dialog is not an option. Also, in both the HTML and the client/server versions, the preferences would be read on the server, but the error needs to be displayed in the web browser or on the client. The readPreferences() method should be designed with these future needs in mind. Proper separation of user interface code from program logic increases the reusability of our code.&lt;br /&gt;&lt;br /&gt;Catching an exception too early, before it can properly be handled, often leads to further errors and exceptions. For example, had the readPreferences() method shown earlier immediately caught and logged the FileNotFoundException that could be thrown while calling the&lt;br /&gt;FileInputStream constructor, the code would look something like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;public void readPreferences(String filename)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; //...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; InputStream in = null;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; // DO NOT DO THIS!!!&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; try&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;     in = new FileInputStream(filename);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; catch (FileNotFoundException e)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;     logger.log(e);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; in.read(...);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; //...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This code catches FileNotFoundException, when it really cannot do anything to recover from the error. If the file is not found, the rest of the method certainly cannot read from the file. What would happen should readPreferences() be called with the name of file that doesn't exist? Sure, the FileNotFoundException would be logged, and if we happened to be looking at the log file at the time, we'd be aware of this. But what happens when the program tries to read data from the file? Since the file doesn't exist, in is null, and a NullPointerException gets thrown.&lt;br /&gt;&lt;br /&gt;When debugging a program, instinct tells us to look at the latest information in the log. That's going to be the NullPointerException, dreaded because it is so unspecific. The stack trace lies, not only about what went wrong (the real error is a FileNotFoundException, not a NullPointerException), but also about where the error originated. The problem occurred several lines of code away from where the NullPointerException was thrown, and it could have easily been several method calls and classes removed. We end up wasting time chasing red herrings that distract our attention from the true source of the error. It is not until we scroll back in the log file that we see what actually caused the program to malfunction.&lt;br /&gt;&lt;br /&gt;What should readPreferences() do instead of catching the exceptions? It may seem counterintuitive, but often the best approach is to simply let it go; don't catch the exception immediately. Leave that responsibility up to the code that calls readPreferences(). Let that code determine the appropriate way to handle a missing preferences file, which could mean prompting the user for another file, using default values, or, if no other approach works, alerting the user of the problem and exiting the application.&lt;br /&gt;&lt;br /&gt;The way to pass responsibility for handling exceptions further up the call chain is to declare the exception in the throws clause of the method. When declaring which exceptions may be thrown, remember to be as specific as possible. This serves to document what types of exceptions a program calling your method should anticipate and be ready to handle. For example, the "catch late" version of the readPreferences() method would look like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;public void readPreferences(String filename)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; throws IllegalArgumentException,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        FileNotFoundException, IOException&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; if (filename == null)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;     throw new IllegalArgumentException&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                     ("filename is null");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; }  //if&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; //...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; InputStream in = new FileInputStream(filename);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; //...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Technically, the only exception we need to declare is IOException, but we document our code by declaring that the method may specifically throw a FileNotFoundException. IllegalArgumentException need not be declared, because it is an unchecked exception (a subclass of RuntimeException). Still, including it serves to document our code (the exceptions should also be noted in the JavaDocs for the method).&lt;br /&gt;&lt;br /&gt;Of course, eventually, your program needs to catch exceptions, or it may terminate unexpectedly. But the trick is to catch exceptions at the proper layer, where your program can either meaningfully recover from the exception and continue without causing further errors, or provide the user with specific information, including instructions on how to recover from the error. When it is not practical for a method to do either of these, simply let the exception go so it can be caught later on and handled at the appropriate level.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Conclusion&lt;/span&gt;&lt;br /&gt;Experienced developers know that the hardest part of debugging usually is not fixing the bug, but finding where in the volumes of code the bug hides. By following the three rules in this article, you can help exceptions help you track down and eradicate bugs and make your programs more robust and user-friendly.&lt;br /&gt;&lt;br /&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;</description><link>http://ashishmishra16.blogspot.com/2008/01/three-rules-for-effective-exception.html</link><author>noreply@blogger.com (&lt;b&gt; Ashish Kumar Mishra&lt;/b&gt;  Location:  &lt;b&gt;Pune, India&lt;/b&gt;)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHDH716Zjog6p_-_TrvCP07b0Z7IofZhvs0TCC6n9NusTiEow6XpoHx3tKc4FLGvIY4LxyDp_UrKX3jyft3FLmd5lVa3v_h7A-iyjjEu5jokJBR7O7P20kVw0luAjBqnAmGvKf/s72-c/exception.gif" width="72"/><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-22938274.post-7949127551260747596</guid><pubDate>Wed, 05 Dec 2007 02:53:00 +0000</pubDate><atom:updated>2007-12-05T08:51:44.445+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">NetBeans 6</category><title>Waoo - Netbeans 6 is Available</title><description>The much awaited IDE NetBeans 6 is out today. In morning when i saw the email from net beans stating:&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;[nbannounce] NetBeans IDE 6.0 Available&lt;/span&gt;.&lt;br /&gt;I couldn't stop myself from digging its features. It supports almost all current technologies and standard of Java/J2EE/Web Services/SOA.&lt;br /&gt;&lt;br /&gt;Even, I ordered for a Free starter kit DVD. So why Don't you order or download the NetBeans 6 Today. NetBeans is easy to use IDE. Here is link to order a Starter Kit:&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;spanstyle="font-weight:bold;"&gt;&lt;a href="http://www.netbeans.org/about/media.html" target="_blank"&gt;Get My Own NetBeans 6 Starter Kit&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;or Click the Image to get It:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.netbeans.org/about/media.html" target="_blank"&gt;&lt;img style="float:center; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmc_pFaUGxMkcir8v9dKbq5ij3h56CC52kQwi7rA433NTHUybdMs85P-_TyLcGuUR0jjTQqDhyQdKBz7FOkDeoKCCPK0AvKFZFKi1VFdiyQgNu9v2-EBMIBQXay5WlIUvFl22K/s320/NetBeans.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5140321188520178722" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;NetBeans 6 DVD includes:&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;NetBeans IDE 6.0 with all packs&lt;br /&gt;Java(TM) Platform Standard Edition Development Kit (JDK) 6.0 Update 3, &lt;br /&gt;Java Tutorials, &lt;br /&gt;NetBeans tutorials and screencasts. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Following Operating Systems are Supported:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Windows, &lt;br /&gt;Linux, &lt;br /&gt;Solaris x86, &lt;br /&gt;Solaris SPARC &lt;br /&gt;Mac OS X.&lt;/span&gt;&lt;br /&gt;Currently,  The NetBeans starter kit is available in English language, but very soon it will be available in other languages also.&lt;br /&gt;&lt;br /&gt;So what are you waiting for. Just register and Get it.</description><link>http://ashishmishra16.blogspot.com/2007/12/waoo-netbeans-6-is-available.html</link><author>noreply@blogger.com (&lt;b&gt; Ashish Kumar Mishra&lt;/b&gt;  Location:  &lt;b&gt;Pune, India&lt;/b&gt;)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmc_pFaUGxMkcir8v9dKbq5ij3h56CC52kQwi7rA433NTHUybdMs85P-_TyLcGuUR0jjTQqDhyQdKBz7FOkDeoKCCPK0AvKFZFKi1VFdiyQgNu9v2-EBMIBQXay5WlIUvFl22K/s72-c/NetBeans.JPG" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-22938274.post-6526938320717296746</guid><pubDate>Sun, 14 Oct 2007 03:16:00 +0000</pubDate><atom:updated>2007-10-14T09:11:54.030+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Google Desktop</category><category domain="http://www.blogger.com/atom/ns#">Google Pack</category><title>Google Desktop Search - Awesome Tool</title><description>Hi Friends,&lt;br /&gt;&lt;br /&gt;I found something very interesting something about google desktop search. I think, it is really useful to share with you people.&lt;br /&gt;&lt;br /&gt;Google Desktop Search acts as your own personal Google Server and indexes the contents your system by file name, or in the case of select file formats, by the contents of the file. It runs on Windows XP and Windows 2000 (with Service Pack 3).&lt;br /&gt;&lt;br /&gt;The free download indexes the full text of email created in Outlook or Outlook Express, Word documents, Excel spreadsheets, PowerPoint presentations, AOL Instant Messages, and caches the pages you view in Internet Explorer so you can revisit the page later "even if its live content has changed or you're offline."&lt;br /&gt;&lt;br /&gt;The install is really simple and after you install it starts indexing. If you are working on your system then it will take a while to index. As soon as it realizes the machine is idle it starts churning away. After it indexes the data you are presented with a browser based interface much like the google we all know. Yes is it lightening fast, typing in JRun on my machine turned up 24,107 entries for files and 27,823 for web history, all that in .5 seconds. It looks through basically anything on your machine and indexes it. For free you can't beat this. it is on my short list of the best windows utilities I have ever used.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;So what are you thinking, just download the Google Pack, It contains All the necessary softwares, which makes your PC useful.... &lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;a href="http://www.geocities.com/ashish4u4ever2003/Contact.html"&gt;Download it from Here &lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEii1aoxMvRytwJ6VpHSd7ewUUkxr9GP2zqVM0uHot9iC_M6l08qGBiseSA8kXYPW8wc4r2SmBmuC4H-JL-EHCBsuiZZbd4p7YuY7oFfn4dy2R_PkIaHAvoGrMh_VHb0GFaGh6Tj/s1600-h/google-pack.gif"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEii1aoxMvRytwJ6VpHSd7ewUUkxr9GP2zqVM0uHot9iC_M6l08qGBiseSA8kXYPW8wc4r2SmBmuC4H-JL-EHCBsuiZZbd4p7YuY7oFfn4dy2R_PkIaHAvoGrMh_VHb0GFaGh6Tj/s320/google-pack.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5121030764017968450" /&gt;&lt;/a&gt;&lt;/span&gt;</description><link>http://ashishmishra16.blogspot.com/2007/10/google-desktop-search-awesome-tool.html</link><author>noreply@blogger.com (&lt;b&gt; Ashish Kumar Mishra&lt;/b&gt;  Location:  &lt;b&gt;Pune, India&lt;/b&gt;)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEii1aoxMvRytwJ6VpHSd7ewUUkxr9GP2zqVM0uHot9iC_M6l08qGBiseSA8kXYPW8wc4r2SmBmuC4H-JL-EHCBsuiZZbd4p7YuY7oFfn4dy2R_PkIaHAvoGrMh_VHb0GFaGh6Tj/s72-c/google-pack.gif" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-22938274.post-5368406688602922053</guid><pubDate>Wed, 10 Oct 2007 06:51:00 +0000</pubDate><atom:updated>2007-10-10T15:18:17.502+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">String</category><category domain="http://www.blogger.com/atom/ns#">String Handling</category><category domain="http://www.blogger.com/atom/ns#">StringBuffer</category><category domain="http://www.blogger.com/atom/ns#">StringBuilder</category><title>Manipulating String intelligently</title><description>Performance and Optimizations are the key features desired in Java Programming. So here are some examples, how to make improvement in your String manipulation..&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghFdnF6hQ7LtaTdjSN3ZuYAbvl00O0xYhQRsE25HqigZr2VydSVGz_7RzrmRFvOjf9-3g60ASv6X43DhgY1S0G72lsu8b95tjNwnRKVWC2-T1I-Z7POXTPQNy1_w7XCDk74S_t/s1600-h/cheetah.gif"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghFdnF6hQ7LtaTdjSN3ZuYAbvl00O0xYhQRsE25HqigZr2VydSVGz_7RzrmRFvOjf9-3g60ASv6X43DhgY1S0G72lsu8b95tjNwnRKVWC2-T1I-Z7POXTPQNy1_w7XCDk74S_t/s320/cheetah.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5119626253877601362" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;String is the most encountered Objects in Java Programming. Till Tiger, we have 3 Classes to manipulate Strings. These are String, StringBuilder, StringBuffer.&lt;br /&gt;&lt;br /&gt;String is immutable whereas StringBuffer and StringBuilder can change their values.&lt;br /&gt;&lt;br /&gt;StringBuilder was introduced in J2SE5 or Tiger.The only difference between StringBuffer and StringBuilder is that StringBuilder is unsynchronized whereas StringBuffer is synchronized. So when the application needs to be run only in a single thread then it is better to use StringBuilder. StringBuilder is more efficient than StringBuffer.&lt;br /&gt;&lt;br /&gt;Here are some examples given by Mr. Heinz Kabutz about how to perform String Manipulation intelligently.&lt;br /&gt;&lt;br /&gt;We start with a basic concatenation based on +=:&lt;br /&gt;&lt;br /&gt;  public static String concat1(String s1, String s2, String s3,&lt;br /&gt;                               String s4, String s5, String s6) {&lt;br /&gt;    String result = "";&lt;br /&gt;    result += s1;&lt;br /&gt;    result += s2;&lt;br /&gt;    result += s3;&lt;br /&gt;    result += s4;&lt;br /&gt;    result += s5;&lt;br /&gt;    result += s6;&lt;br /&gt;    return result;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;String is immutable, so the compiled code will create many intermediate String objects, which can strain the garbage collector. A common remedy is to introduce StringBuffer, causing it to look like this:&lt;br /&gt;&lt;br /&gt;public static String concat2(String s1, String s2, String s3,&lt;br /&gt;                               String s4, String s5, String s6) {&lt;br /&gt;    StringBuffer result = new StringBuffer();&lt;br /&gt;    result.append(s1);&lt;br /&gt;    result.append(s2);&lt;br /&gt;    result.append(s3);&lt;br /&gt;    result.append(s4);&lt;br /&gt;    result.append(s5);&lt;br /&gt;    result.append(s6);&lt;br /&gt;    return result.toString();&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;But the code is becoming less legible, which is undesirable.&lt;br /&gt;&lt;br /&gt;Using JDK 6.0_02 and the server HotSpot compiler, I can execute concat1() a million times in 2013 milliseconds, but concat2() in 734 milliseconds. At this point, I might congratulate myself for making the code three times faster. However, the user won't notice it if 0.1 percent of the program becomes three times faster.&lt;br /&gt;&lt;br /&gt;Here's a third approach that I used to make my code run faster, back in the days of JDK 1.3. Instead of creating an empty StringBuffer, I sized it to the number of required characters, like so:&lt;br /&gt;&lt;br /&gt;  public static String concat3(String s1, String s2, String s3,&lt;br /&gt;                               String s4, String s5, String s6) {&lt;br /&gt;    return new StringBuffer(&lt;br /&gt;        s1.length() + s2.length() + s3.length() + s4.length() +&lt;br /&gt;            s5.length() + s6.length()).append(s1).append(s2).&lt;br /&gt;        append(s3).append(s4).append(s5).append(s6).toString();&lt;br /&gt;  } &lt;br /&gt;&lt;br /&gt;I managed to call that a million times in 604 milliseconds. Even faster than concat2(). But is this the best way to add the strings? And what is the simplest way?&lt;br /&gt;&lt;br /&gt;The approach in concat4() illustrates another way:&lt;br /&gt;&lt;br /&gt;  public static String concat4(String s1, String s2, String s3,&lt;br /&gt;                               String s4, String s5, String s6) {&lt;br /&gt;    return s1 + s2 + s3 + s4 + s5 + s6;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;You can hardly make it simpler than that. Interestingly, in Java SE 6, I can call the code a million times in 578 milliseconds, which is even better than the far more complicated concat3(). The method is cleaner, easier to understand, and quicker than our previous best effort.&lt;br /&gt;&lt;br /&gt;Sun introduced the StringBuilder class in J2SE 5.0, which is almost the same as StringBuffer, except it's not thread-safe. Thread safety is usually not necessary with StringBuffer, since it is seldom shared between threads. When Strings are added using the + operator, the compiler in J2SE 5.0 and Java SE 6 will automatically use StringBuilder. If StringBuffer is hard-coded, this optimization will not occur.&lt;br /&gt;&lt;br /&gt;When a time-critical method causes a significant bottleneck in your application, it's possible to speed up string concatenation by doing this:&lt;br /&gt;&lt;br /&gt;  public static String concat5(String s1, String s2, String s3,&lt;br /&gt;                               String s4, String s5, String s6) {&lt;br /&gt;    return new StringBuilder(&lt;br /&gt;      s1.length() + s2.length() + s3.length() + s4.length() +&lt;br /&gt;          s5.length() + s6.length()).append(s1).append(s2).&lt;br /&gt;        append(s3).append(s4).append(s5).append(s6).toString();&lt;br /&gt;  } &lt;br /&gt;&lt;br /&gt;However, doing this prevents future versions of the Java platform from automatically speeding up the system, and again, it makes the code more difficult to read.&lt;br /&gt;&lt;br /&gt;Source: By Mr. Heinz Kabutz(Java Champions) (creator of the free Java Specialists' Newsletter)</description><link>http://ashishmishra16.blogspot.com/2007/10/manipulating-string-intelligently.html</link><author>noreply@blogger.com (&lt;b&gt; Ashish Kumar Mishra&lt;/b&gt;  Location:  &lt;b&gt;Pune, India&lt;/b&gt;)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghFdnF6hQ7LtaTdjSN3ZuYAbvl00O0xYhQRsE25HqigZr2VydSVGz_7RzrmRFvOjf9-3g60ASv6X43DhgY1S0G72lsu8b95tjNwnRKVWC2-T1I-Z7POXTPQNy1_w7XCDk74S_t/s72-c/cheetah.gif" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-22938274.post-5404277922526140117</guid><pubDate>Sun, 19 Aug 2007 09:17:00 +0000</pubDate><atom:updated>2007-08-19T15:10:23.444+05:30</atom:updated><title>Calendar class - Better Way to Manipulate Dates.</title><description>&lt;st1:street st="on"&gt;&lt;st1:address st="on"&gt;&lt;b style=""&gt;&lt;span style="font-size:15;"&gt;&lt;/span&gt;&lt;/b&gt;&lt;/st1:address&gt;&lt;/st1:street&gt;  &lt;p&gt;Java’s Calendar class offers a set of methods for converting and manipulating temporal information. In addition to retrieving the current date and time, the Calendar class also provides an API for date arithmetic. Calendar’s built-in date/time arithmetic API is extremely useful. &lt;/p&gt;  &lt;p&gt;This tutorial examines the Calendar class API and presents examples of how you can use Calendar objects to add and subtract time spans to and from dates and times, as well as how to evaluate whether one date precedes or follows another.&lt;/p&gt;  &lt;h2&gt;&lt;span style="font-size:14;"&gt;Adding time spans&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;p&gt;Let’s say you want to add a time span to a starting date and print the result. Consider the following example, which initializes a Calendar to 16 July 2007 and then adds two months and three days to it to obtain a new value:&lt;/p&gt;  &lt;pre&gt;import java.text.SimpleDateFormat;&lt;/pre&gt;&lt;pre&gt;import java.util.Calendar;&lt;/pre&gt;&lt;pre&gt;import java.util.GregorianCalendar;&lt;span style=""&gt;     &lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;public class CalenderDemo{&lt;/pre&gt;&lt;pre&gt; public static void main(String[] args) {&lt;/pre&gt;&lt;pre&gt;  CalenderDemo tdt = new CalenderDemo();&lt;/pre&gt;&lt;pre&gt;  tdt.calculateDate();&lt;/pre&gt;&lt;pre&gt; }   &lt;/pre&gt;&lt;pre&gt; private void calculateDate(){&lt;/pre&gt;&lt;pre&gt;  //Creating a calendar instance with initial date&lt;br /&gt; 16&lt;sup&gt; &lt;/sup&gt;July 2007&lt;/pre&gt;&lt;pre&gt;  Calendar calendar = new GregorianCalendar&lt;br /&gt;                        (2007,Calendar.JULY,16);&lt;/pre&gt;&lt;pre&gt;  System.out.println("Initial date is: ");&lt;/pre&gt;&lt;pre&gt;  printFormattedDate(calendar);&lt;span style=""&gt;     &lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;  // Adding 2 Months and 3 day here&lt;/pre&gt;&lt;pre&gt;  calendar.add(Calendar.MONTH,2);&lt;/pre&gt;&lt;pre&gt;  calendar.add(Calendar.DAY_OF_MONTH,3);&lt;/pre&gt;&lt;pre&gt;  // printing modified date value&lt;/pre&gt;&lt;pre&gt;  System.out.println("New date is: ");&lt;/pre&gt;&lt;pre&gt;  printFormattedDate(calendar);&lt;/pre&gt;&lt;pre&gt; }&lt;/pre&gt;&lt;pre&gt; /** Method to print Formatted Date&lt;br /&gt;    SimpleDateFormat  */&lt;/pre&gt;&lt;pre&gt; private void printFormattedDate(Calendar calendar){&lt;/pre&gt;&lt;pre&gt;  // define output format and print&lt;/pre&gt;&lt;pre&gt;  SimpleDateFormat sdf = new SimpleDateFormat&lt;br /&gt;                            ("d MMM yyyy hh:mm aaa");&lt;/pre&gt;&lt;pre&gt;  String date = sdf.format(calendar.getTime());&lt;/pre&gt;&lt;pre&gt;  System.out.println(date);&lt;/pre&gt;&lt;pre&gt; }&lt;/pre&gt;&lt;pre&gt;}&lt;/pre&gt;  &lt;p&gt;The main workhorse of this class is the doMath() method, which begins by initializing a new GregorianCalendar object to 16 July 2007. Next, the object’s add() method is invoked; this method accepts two arguments: the name of the field to add the value to and the amount of time to be added. In this example, the add() method is called twice — first to add two months to the starting date and then to add a further one day to the result. Once the addition is performed, the printCalendar() utility method is used to print the final result. &lt;/p&gt;  &lt;p&gt;The use of the SimpleDateFormat object to turn the output of getTime() into a human-readable string. This class is a part of java.text. package. &lt;/p&gt;  &lt;p&gt;When you run the class, this is the output you’ll see:&lt;/p&gt;  &lt;pre&gt;Initial date is:&lt;/pre&gt;&lt;pre&gt; 16 July 2007 12:00 AM&lt;/pre&gt;&lt;pre&gt;New date is:&lt;/pre&gt;&lt;pre&gt; 19 September 2007 12:00 AM&lt;/pre&gt;  &lt;p&gt;This kind of addition also works with time values. To illustrate, consider the next example, which adds 14 hours and 55 minutes to a starting time value:&lt;/p&gt;  &lt;pre&gt;/*&lt;/pre&gt;&lt;pre&gt;* Creating an Instance of Calendar with Year,&lt;br /&gt;* Month, data, Hours and&lt;span style=""&gt; &lt;/span&gt;Minutes **/&lt;/pre&gt;&lt;pre&gt;Calendar calendar =new GregorianCalendar&lt;br /&gt;                (2007,Calendar.JANUARY,1, 1,0);&lt;/pre&gt;&lt;pre&gt;System.out.println(“Initial Date is :”);&lt;/pre&gt;&lt;pre&gt;printFormattedDate(calendar);&lt;span style=""&gt;  &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;br /&gt;                //Defined in Above example &lt;/pre&gt;&lt;pre&gt;&lt;o:p&gt; &lt;/o:p&gt;// Add 14h 55min&lt;/pre&gt;&lt;pre&gt;calendar.add(Calendar.HOUR,14);&lt;/pre&gt;&lt;pre&gt;calendar.add(Calendar.MINUTE,55);&lt;/pre&gt;&lt;pre&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;//Print after Adding the hours and minutes        &lt;/pre&gt;&lt;pre&gt;System.out.println(“Modified Date is :”);&lt;/pre&gt;&lt;pre&gt;printFormattedDate(calendar);&lt;span style=""&gt;  &lt;/span&gt;//Defined in Above example.&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;   &lt;/pre&gt;&lt;pre&gt;This is almost identical to the previous class except&lt;br /&gt;that the calls to add() involve the calendar’s hour&lt;br /&gt;and minute fields. Here’s the output:&lt;/pre&gt;&lt;pre&gt;&lt;o:p&gt;&lt;/o:p&gt;Initial Date is:&lt;/pre&gt;    &lt;p style="margin: 0in 0in 0.0001pt;"&gt;1 Jan 2007 01:00 AM&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;Modified Date is&lt;br /&gt;1 Jan 2007 03:55 PM&lt;/p&gt;  &lt;h2&gt;&lt;span style="font-size:14;"&gt;Subtracting time spans&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;p&gt;Subtraction is fairly easy as well — you simply use negative values as the second argument to add(). Here’s an example:&lt;/p&gt;  &lt;pre&gt;// Creating a Date Instance with Year, Month, Day, Hours and Minutes&lt;/pre&gt;&lt;pre&gt;Calendar calendar = new GregorianCalendar&lt;br /&gt;                   (2007,Calendar.JANUARY,2, 3,30);&lt;/pre&gt;&lt;pre&gt;System.out.println("Starting date is: ");&lt;/pre&gt;&lt;pre&gt;printFormattedDate(calendar);&lt;br /&gt;//Defined in First Example.&lt;span style=""&gt;     &lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;// Subtracting 1 Year 1 Day 4 Hours and 5 Minutes&lt;/pre&gt;&lt;pre&gt;System.out.println("Subtracting 1 Year 1&lt;br /&gt;                 Day 4 Hours and 5 Minutes");&lt;/pre&gt;&lt;pre&gt;calendar.add(Calendar.YEAR,-1);&lt;/pre&gt;&lt;pre&gt;calendar.add(Calendar.DAY_OF_MONTH,-1);&lt;/pre&gt;&lt;pre&gt;calendar.add(Calendar.HOUR,-4);&lt;/pre&gt;&lt;pre&gt;calendar.add(Calendar.MINUTE,-5);&lt;/pre&gt;&lt;pre&gt;// print result&lt;/pre&gt;&lt;pre&gt;System.out.println("Ending date is ");&lt;/pre&gt;&lt;pre&gt;printFormattedDate(calendar);&lt;/pre&gt;  &lt;p&gt;Here’s the output:&lt;/p&gt;  &lt;pre&gt;Starting date is:&lt;/pre&gt;&lt;pre&gt;2 Jan 2007 03:30 AM&lt;/pre&gt;&lt;pre&gt;Subtracting 1y 1d 4h 5min...&lt;/pre&gt;&lt;pre&gt;Ending date is&lt;/pre&gt;&lt;pre&gt;31 Dec 2005 11:25 PM&lt;/pre&gt;  &lt;p&gt;In this example, the Calendar object automatically takes care of adjusting the year and the day when the subtraction results in the date “overflowing” from 1 Jan 2006 to 31 Dec 2005.&lt;/p&gt;  &lt;h2&gt;&lt;span style="font-size:14;"&gt;Adding vs. rolling&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;p&gt;As the previous example illustrates, the add() method automatically takes care of rolling over days, months, and years when a particular calendar field “overflows” as a result of addition or subtraction. However, this behavior is often not what you want. In those situations, the Calendar object also has a roll() method, which avoids incrementing or decrementing larger calendar fields when such overflow occurs. To see how this works, look at the following example:&lt;/p&gt;  &lt;pre&gt;Calendar calendar = new GregorianCalendar&lt;br /&gt;                    (2006, Calendar.DECEMBER,1);&lt;/pre&gt;&lt;pre&gt;System.out.println("Starting date for add() &lt;span style=""&gt; &lt;/span&gt;is: ");&lt;/pre&gt;&lt;pre&gt;printFormattedDate(calendar);&lt;span style=""&gt;     &lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;System.out.println("After add()ing 1 month, ending date is: ");&lt;/pre&gt;&lt;pre&gt;calendar.add(Calendar.MONTH, 1);&lt;/pre&gt;&lt;pre&gt;printFormattedDate(calendar);&lt;/pre&gt;&lt;pre&gt;// initialize calendar&lt;/pre&gt;&lt;pre&gt;Calendar calendar2 = new GregorianCalendar&lt;br /&gt;              &lt;br /&gt;(2006, Calendar.DECEMBER,1);&lt;/pre&gt;&lt;pre&gt;System.out.println("Starting date for roll() is: ");&lt;/pre&gt;&lt;pre&gt;printFormattedDate(calendar2);&lt;span style=""&gt;     &lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;System.out.println("After roll()ing 1 month,  ending date is: ");&lt;/pre&gt;&lt;pre&gt;Calendar2.roll(Calendar.MONTH, 1);&lt;/pre&gt;&lt;pre&gt;printFormattedDate(calendar2);&lt;/pre&gt;  &lt;p&gt;Here’s the output:&lt;/p&gt;  &lt;pre&gt;Starting date for add() is:&lt;/pre&gt;&lt;pre&gt; 1 Dec 2006 12:00 AM&lt;/pre&gt;&lt;pre&gt; After add()ing 1 month, ending date is:&lt;/pre&gt;&lt;pre&gt; 1 Jan 2007 12:00 AM&lt;span style=""&gt;     &lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt; Starting date for roll() is:&lt;/pre&gt;&lt;pre&gt; 1 Dec 2006 12:00 AM&lt;/pre&gt;&lt;pre&gt; After roll()ing 1 month, ending date is:&lt;/pre&gt;&lt;pre&gt; 1 Jan 2006 12:00 AM&lt;/pre&gt;  &lt;p&gt;In the first case, when one month is added to the starting date of 1 Dec 2006, the add() method realizes that a year change will occur as a result of the addition, and the year is rolled over to 2007. When using roll(), this behavior is disabled, and only the month field is incremented by 1, with the year change ignored. In many situations, roll() is very useful.&lt;/p&gt;  &lt;h2&gt;&lt;span style="font-size:14;"&gt;Checking date precedence&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;p&gt;The Calendar object also includes the compareTo() method, which lets you compare two dates to find out which one comes earlier. &lt;a name="OLE_LINK2"&gt;&lt;/a&gt;&lt;a name="OLE_LINK1"&gt;&lt;/a&gt;The compareTo() method accepts another Calendar object as an input argument and returns a value less than zero if the following conditions are true:&lt;/p&gt;  &lt;ul type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;The date and time of the      input Calendar object is later than that of the calling Calendar object.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;A value greater than zero if      the reverse is true.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;A value of 0 if the two      Calendar objects represent the same date.&lt;/li&gt;&lt;/ul&gt;  &lt;p&gt;Here’s an example that compares 1 Jan 2007 12:00 AM and 1 Jan 2007 12:01 AM with compareTo():&lt;/p&gt;  &lt;pre&gt;// initialize two calendars&lt;/pre&gt;&lt;pre&gt;Calendar calendar1 = new GregorianCalendar&lt;br /&gt;                   (2007,Calendar.JANUARY,1,0,0,0);&lt;/pre&gt;&lt;pre&gt;Calendar calendar2 = new GregorianCalendar&lt;br /&gt;                   (2007,Calendar.JANUARY,1,0,1,0);&lt;/pre&gt;&lt;pre&gt;// define date format&lt;/pre&gt;&lt;pre&gt;String date1 = null;&lt;/pre&gt;&lt;pre&gt;String date2 = null;&lt;/pre&gt;&lt;pre&gt;SimpleDateFormat sdf = new SimpleDateFormat&lt;br /&gt;                   ("d MMM yyyy hh:mm aaa");&lt;/pre&gt;&lt;pre&gt;// compare dates&lt;/pre&gt;&lt;pre&gt;if((calendar1.compareTo(calendar2)) &lt;&gt;&lt;pre&gt;&lt;span style=""&gt;    &lt;/span&gt;date1 = sdf.format(calendar1.getTime());&lt;/pre&gt;&lt;pre&gt;    date2 = sdf.format(calendar2.getTime());&lt;/pre&gt;&lt;pre&gt;}else{&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;    &lt;/span&gt;date1 = sdf.format(calendar2.getTime());&lt;/pre&gt;&lt;pre&gt;    date2 = sdf.format(calendar1.getTime());&lt;/pre&gt;&lt;pre&gt;}&lt;/pre&gt;&lt;pre&gt;System.out.println(date1 + " occurs before " + date2);&lt;/pre&gt;&lt;pre&gt;System.out.println(date2 + " occurs after  " + date1);&lt;/pre&gt;  &lt;p&gt;Here’s the output:&lt;/p&gt;  &lt;pre&gt;1 Jan 2007 12:00 AM occurs before 1 Jan 2007 12:01 AM&lt;/pre&gt;&lt;pre&gt;1 Jan 2007 12:01 AM occurs after  1 Jan 2007 12:00 AM&lt;/pre&gt;  &lt;br /&gt;&lt;span style="font-size:14;"&gt;&lt;p&gt;&lt;br /&gt;Since Most of the Date/Time classes are deprecated,&lt;br /&gt;Calendar class is very handy to work with.&lt;br /&gt;Alongwith this java.text.DateFormat and&lt;br /&gt;java.text.SimpleDateFormat are very useful to&lt;br /&gt;convert the date to different Locales and&lt;br /&gt;different format.&lt;/p&gt; &lt;/span&gt; &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;/pre&gt;</description><link>http://ashishmishra16.blogspot.com/2007/08/calendar-class-better-way-to-manipulate.html</link><author>noreply@blogger.com (&lt;b&gt; Ashish Kumar Mishra&lt;/b&gt;  Location:  &lt;b&gt;Pune, India&lt;/b&gt;)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-22938274.post-3206313649542539521</guid><pubDate>Thu, 09 Aug 2007 09:13:00 +0000</pubDate><atom:updated>2007-08-09T14:44:54.778+05:30</atom:updated><title>Reflection APIs - A way to inspect classes at runtime</title><description>&lt;p class="takeaway"&gt;Java Reflection is a technology that looks inside a Java object at runtime and sees basically everything about the object that you would know at compile time. &lt;/p&gt;  &lt;p&gt;Java Reflection is a technology that looks inside a Java object at runtime and sees what variables it contains, what methods it supports, what interfaces it implements, what classes it extends—basically everything about the object that you would know at compile time.&lt;/p&gt;  &lt;p&gt;The Reflection API is located in the java.lang.reflect package and is included in any J2SE installation. Primarily it is intended for very generic programs such as database browsers or visual code editors, but it can be used in any other applications. Reflection is for &lt;/p&gt;  &lt;h2&gt;Basic techniques&lt;/h2&gt;  &lt;p&gt;There are two basic techniques involved in Reflection: discovery and use by name. Here are descriptions of both:&lt;/p&gt;  &lt;ul type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;Discovery&lt;/b&gt; involves      taking an object or class and discovering the members, superclasses,      implemented interfaces, and then possibly using the discovered elements.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;Use by name&lt;/b&gt; involves      starting with the symbolic name of an element and using the named element.&lt;/li&gt;&lt;/ul&gt;  &lt;p&gt;Discovery typically starts with an object and then calls the Object.getClass() method to get the object's Class. The Class object has a number of methods for discovering the contents of the class. Here are some of those methods:&lt;/p&gt;  &lt;ul type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;getMethods():&lt;/b&gt; returns      an array of Method objects representing all of the public methods of the      class or interface.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;getConstructors():&lt;/b&gt;      returns an array of Constructor objects representing all of the public      constructors of the class.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;getFields():&lt;/b&gt; returns      an array of Field objects representing all of the public fields of the      class or interface.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;getClasses():&lt;/b&gt; returns      an array of Class objects representing all of the public classes and      interfaces that are members (e.g., inner classes) of the class or      interface.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;getSuperclass():&lt;/b&gt;      returns the Class object representing the superclass of the class or      interface (null is returned for interfaces).&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;getInterfaces():&lt;/b&gt;      returns an array of Class objects representing all of the interfaces that      are implemented by the class or interface.&lt;/li&gt;&lt;/ul&gt;  &lt;p&gt;You can obtain the Class object either through discovery, by using the class literal (e.g., MyClass.class), or by using the name of the class (e.g., Class.forName("mypackage.MyClass")). With a Class object, member objects Method, Constructor, or Field can be obtained using the symbolic name of the member. These are the most important techniques:&lt;/p&gt;  &lt;ul type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;getMethod("methodName",      Class...):&lt;/b&gt; returns the Method object representing the public method      with the name "methodName" of the class or interface that      accepts the parameters specified by the Class... parameters.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;getConstructor(Class...):&lt;/b&gt;      returns the Constructor object representing the public constructor of the      class that accepts the parameters specified by the Class... parameters.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;getField("fieldName"):&lt;/b&gt;      returns the Field object representing the public field with the name      "fieldName" of the class or interface.&lt;/li&gt;&lt;/ul&gt;  &lt;p&gt;You can use Method, Constructor, and Field objects to dynamically access the represented member of the class. For example:&lt;/p&gt;  &lt;ul type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;Field.get(Object):&lt;/b&gt;      returns an Object containing the value of the field from the instance of      the object passed to get(). (If the Field object represents a static      field, the Object parameter is ignored and may be null.)&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;Method.invoke(Object,      Object...):&lt;/b&gt; returns an Object containing the result of invoking the      method for the instance of the first Object parameter passed to invoke().      The remaining Object... parameters are passed to the method. (If the      Method object represents a static method, the first Object parameter is      ignored and may be null.)&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;Constructor.newInstance(Object...):&lt;/b&gt;      returns the new Object instance from invoking the constructor. The      Object... parameters are passed to the constructor. (Note that the      parameterless constructor for a class can also be invoked by calling      newInstance().)&lt;/li&gt;&lt;/ul&gt;  &lt;h2&gt;Creating arrays and proxy classes&lt;/h2&gt;  &lt;p&gt;The java.lang.reflect package provides an Array class that contains static methods for creating and manipulating array objects. Since J2SE 1.3, the java.lang.reflect package also provides a Proxy class that supports dynamic creation of proxy classes, which implement specified interfaces.&lt;/p&gt;  &lt;p&gt;The implementation of a Proxy class is provided by a supplied object that implements the InvocationHandler interface. The InvocationHandler's method invoke (Object, Method, Object[]) is called for each method invoked on the proxy object—the first parameter is the proxy object, the second parameter is the Method object representing the method from the interface implemented by the proxy, and the third parameter is the array of parameters passed to the interface method. The invoke() method returns an Object result that contains the result returned to the code that called the proxy interface method.&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:14;"&gt;Eaxmple of Reflection is :&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;import java.lang.reflect.Constructor;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;import java.lang.reflect.Field;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;import java.lang.reflect.Method;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;import java.lang.reflect.Member;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;import static java.lang.System.out;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;enum ClassMember { CONSTRUCTOR, FIELD, METHOD, CLASS, ALL }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;public class ClassSpy {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;    &lt;/span&gt;public static void main(String... args) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;try {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;Class c = Class.forName(args[0]);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;out.format("Class:%n&lt;span style=""&gt;  &lt;/span&gt;%s%n%n", c.getCanonicalName());&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;Package p = c.getPackage();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;out.format("Package:%n&lt;span style=""&gt;  &lt;/span&gt;%s%n%n",&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;&lt;span style=""&gt;       &lt;/span&gt;(p != null ? p.getName() : "-- No Package --"));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;for (int i = 1; i &lt;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;switch (ClassMember.valueOf(args[i])) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;case CONSTRUCTOR:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;printMembers(c.getConstructors(), "Constructor");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;break;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;case FIELD:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;printMembers(c.getFields(), "Fields");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;break;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;case METHOD:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;printMembers(c.getMethods(), "Methods");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;break;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;case CLASS:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;printClasses(c);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;break;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;case ALL:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;printMembers(c.getConstructors(), "Constuctors");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;printMembers(c.getFields(), "Fields");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;printMembers(c.getMethods(), "Methods");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;printClasses(c);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;break;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;default:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;assert false;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;// production code should handle these exceptions more gracefully&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;} catch (ClassNotFoundException x) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;x.printStackTrace();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;    &lt;/span&gt;private static void printMembers(Member[] mbrs, String s) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;out.format("%s:%n", s);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;for (Member mbr : mbrs) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;if (mbr instanceof Field)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;out.format("&lt;span style=""&gt;  &lt;/span&gt;%s%n", ((Field)mbr).toGenericString());&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;else if (mbr instanceof Constructor)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;out.format("&lt;span style=""&gt;  &lt;/span&gt;%s%n", ((Constructor)mbr).toGenericString());&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;else if (mbr instanceof Method)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;                               &lt;/span&gt;out.format("&lt;span style=""&gt;  &lt;/span&gt;%s%n", ((Method)mbr).toGenericString());&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;if (mbrs.length == 0)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;out.format("&lt;span style=""&gt;  &lt;/span&gt;-- No %s --%n", s);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;out.format("%n");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;    &lt;/span&gt;private static void printClasses(Class c) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;out.format("Classes:%n");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;Class[] clss = c.getClasses();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;for (Class cls : clss)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;out.format("&lt;span style=""&gt;  &lt;/span&gt;%s%n", cls.getCanonicalName());&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;if (clss.length == 0)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;out.format("&lt;span style=""&gt;  &lt;/span&gt;-- No member interfaces, classes, or enums --%n");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;               &lt;/span&gt;out.format("%n");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;span style=""&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;}&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:14;"&gt;Further References:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:14;"&gt;http://java.sun.com/docs/books/tutorial/reflect/index.html&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;</description><link>http://ashishmishra16.blogspot.com/2007/08/reflection-apis-way-to-inspect-classes.html</link><author>noreply@blogger.com (&lt;b&gt; Ashish Kumar Mishra&lt;/b&gt;  Location:  &lt;b&gt;Pune, India&lt;/b&gt;)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-22938274.post-8317584227431999534</guid><pubDate>Fri, 27 Jul 2007 04:16:00 +0000</pubDate><atom:updated>2008-07-25T17:11:53.380+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><title>Java Singleton Pattern :  Potential Problems and Solutions</title><description>&lt;p&gt;The Java Singleton pattern belongs to the family of design patterns that governs the instantiation process. This design pattern suggests that at any time there can only be one instance of a Singleton (object) created by the JVM. You implement the pattern by creating a class with a method that creates a new instance of the class if one does not exist. If an instance of the class exists, it simply returns a reference to that object.&lt;/p&gt;  &lt;h2&gt;&lt;span style="font-size: 14pt;"&gt;How the Singleton pattern works:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;p&gt;Here’s a typical example of Singleton:&lt;/p&gt;  &lt;pre&gt;public class Singleton {&lt;/pre&gt;&lt;pre&gt;        private final static Singleton INSTANCE = new Singleton();&lt;/pre&gt;&lt;pre&gt;      // Private constructor suppresses generation of&lt;/pre&gt;&lt;pre&gt;    // a (public) default constructor&lt;/pre&gt;&lt;pre&gt;    private Singleton() {}&lt;/pre&gt;&lt;pre&gt;    public static Singleton getInstance() {&lt;/pre&gt;&lt;pre&gt;      return INSTANCE;&lt;/pre&gt;&lt;pre&gt;    }&lt;/pre&gt;&lt;pre&gt; }&lt;/pre&gt;  &lt;p&gt;The classic Singleton does not use direct instantiation of a static variable with declaration — it instantiates a static instance variable in the constructor without checking to see if it already exists:&lt;/p&gt;  &lt;pre&gt;public class ClassicSingleton {&lt;/pre&gt;&lt;pre&gt;    private static ClassicSingleton INSTANCE = null;&lt;/pre&gt;&lt;pre&gt;    private ClassicSingleton() {&lt;/pre&gt;&lt;pre&gt;       // Exists only to defeat instantiation.&lt;/pre&gt;&lt;pre&gt;    }&lt;/pre&gt;&lt;pre&gt;    public static ClassicSingleton getInstance() {&lt;/pre&gt;&lt;pre&gt;       if(INSTANCE == null) {&lt;/pre&gt;&lt;pre&gt;          INSTANCE = new ClassicSingleton();&lt;/pre&gt;&lt;pre&gt;       }&lt;/pre&gt;&lt;pre&gt;       return INSTANCE;&lt;/pre&gt;&lt;pre&gt;    }&lt;/pre&gt;&lt;pre&gt; }&lt;/pre&gt;&lt;pre&gt;Or alternative way is :&lt;/pre&gt;&lt;pre&gt;public class ClassicSingleton {&lt;/pre&gt;&lt;pre&gt;    private static ClassicSingleton INSTANCE = null;&lt;/pre&gt;&lt;pre&gt;    &lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;    &lt;/span&gt;static{&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;INSTANCE = new ClassicSingleton();&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;    &lt;/span&gt;}&lt;span style=""&gt;    &lt;/span&gt;&lt;span style=""&gt;      &lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;    &lt;/span&gt;private ClassicSingleton() {&lt;/pre&gt;&lt;pre&gt;       // Exists only to defeat instantiation.&lt;/pre&gt;&lt;pre&gt;    }&lt;/pre&gt;&lt;pre&gt;    public static ClassicSingleton getInstance() {      &lt;/pre&gt;&lt;pre&gt;       return INSTANCE;&lt;/pre&gt;&lt;pre&gt;    }&lt;/pre&gt;&lt;pre&gt; }&lt;/pre&gt;  &lt;p&gt;The static construct ensure that the object is created when the class is loaded by the JVM. The Singleton class’s default constructor is made private, which prevents the direct instantiation of the object by other classes using the &lt;em&gt;new&lt;/em&gt; keyword. A static modifier is applied to the instance method that returns the Singleton object; it makes this a class level method that can be accessed without creating an object.&lt;/p&gt;  &lt;h2&gt;When you need Singleton&lt;/h2&gt;  &lt;p&gt;Singletons are truly useful when you need only one instance of a class, and it is undesirable to have more than one instance of a class.&lt;/p&gt;  &lt;p&gt;When designing a system, you usually want to control how an object is used and prevent users (including yourself) from making copies of it or creating new instances. For example, you can use it to create a connection pool. It’s not wise to create a new connection every time a program needs to write something to a database; instead, a connection or a set of connections that are already a pool can be instantiated using the Singleton pattern.&lt;/p&gt;  &lt;p&gt;The Singleton pattern is often used in conjunction with the factory method pattern to create a systemwide resource whose specific type is not known to the code that uses it. An example of using these two patterns together is the Abstract Windowing Toolkit (AWT). In GUI applications, you often need only one instance of a graphical element per application instance, like the Print dialog box or the OK button.&lt;/p&gt;  &lt;h2&gt;Check out for potential problems&lt;/h2&gt;  &lt;p&gt;Although the Singleton design pattern is one of the simplest design patterns, it has some limitations.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Construct in multi-threaded applications&lt;/strong&gt;&lt;br /&gt;You must carefully construct the Singleton pattern in multi-threaded applications. If two threads are to execute the creation method at the same time when a Singleton does not exist, both must check for an instance of the Singleton, but only one thread should create the new object. The classic solution to this problem is to use mutual exclusion on the class that indicates that the object is being instantiated. This is a thread-safe version of a Singleton:&lt;/p&gt;  &lt;pre&gt;public class Singleton&lt;/pre&gt;&lt;pre&gt; {&lt;/pre&gt;&lt;pre&gt;   // Private constructor suppresses generation&lt;/pre&gt;&lt;pre&gt;   //  of a (public) default constructor&lt;/pre&gt;&lt;pre&gt;   private Singleton() {}&lt;/pre&gt;&lt;pre&gt;   private static class SingletonHolder{&lt;/pre&gt;&lt;pre&gt;     private final static Singleton INSTANCE = new Singleton();&lt;/pre&gt;&lt;pre&gt;   }  &lt;/pre&gt;&lt;pre&gt;   public static Singleton getInstance(){&lt;/pre&gt;&lt;pre&gt;     return SingletonHolder.INSTANCE;&lt;/pre&gt;&lt;pre&gt;   }&lt;/pre&gt;&lt;pre&gt; }&lt;/pre&gt;  &lt;p&gt;For an alternative solution, you can add the &lt;em&gt;synchronized&lt;/em&gt; keyword to the getInstance() method declaration:&lt;/p&gt;  &lt;pre&gt;   public static synchronized Singleton getInstance()&lt;/pre&gt;  &lt;p&gt;&lt;strong&gt;Think ahead about cloning prevention&lt;/strong&gt;&lt;br /&gt;You can still create a copy of the Singleton object by &lt;a href="http://blogs.techrepublic.com.com/programming-and-development/?p=424" target="_blank"&gt;cloning&lt;/a&gt; it using the Object’s clone() method. To forbid this, you need to override the Object’s clone method, which throws a CloneNotSupportedException exception:&lt;/p&gt;  &lt;pre&gt;      public Object clone() throws CloneNotSupportedException {&lt;/pre&gt;&lt;pre&gt;         throw new CloneNotSupportedException();&lt;/pre&gt;&lt;pre&gt;       }&lt;/pre&gt;  &lt;p&gt;&lt;strong&gt;Consider making the singleton class final&lt;/strong&gt;&lt;br /&gt;You may want to make the Singleton class final to avoid sub classing of Singletons that may cause other problems.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Remember about garbage collection&lt;/strong&gt;&lt;br /&gt;Depending on your implementation, your Singleton class and all of its data might be garbage collected. This is why you must ensure that there must be a live reference to the Singleton class when the application is running.&lt;/p&gt;    &lt;p&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;br /&gt;The Singleton pattern is widely used and has proved its usability in designing software. Although the pattern is not specific to Java, it has become a classic in Java programming.&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;</description><link>http://ashishmishra16.blogspot.com/2007/07/java-singleton-pattern-potential.html</link><author>noreply@blogger.com (&lt;b&gt; Ashish Kumar Mishra&lt;/b&gt;  Location:  &lt;b&gt;Pune, India&lt;/b&gt;)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-22938274.post-565850474498117800</guid><pubDate>Fri, 05 Jan 2007 07:53:00 +0000</pubDate><atom:updated>2007-01-05T13:36:34.569+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">About  Struts</category><title>Struts Are the Really Very Beautiful..................</title><description>Three Days Before Struts started in Training program. I Heard that Struts are very difficult to understand. But After three days, I found how beautifully they are designed by the Craig R. McClanahan. &lt;br /&gt;&lt;br /&gt;I also learned Here in current company that learning the concepts is very neccessary rather than just gulping the APIS. I really thank our instructor for this.  &lt;br /&gt;&lt;br /&gt;Hey I m not going to write about the struts, since web is just full of such kind of material. The spirit is to force urself to learn the basics of anything. Technology may change not the basic concepts.&lt;br /&gt;&lt;br /&gt;Time to Take a Break.</description><link>http://ashishmishra16.blogspot.com/2007/01/struts-are-really-very-beautiful.html</link><author>noreply@blogger.com (&lt;b&gt; Ashish Kumar Mishra&lt;/b&gt;  Location:  &lt;b&gt;Pune, India&lt;/b&gt;)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-22938274.post-1796850682811143456</guid><pubDate>Thu, 23 Nov 2006 11:53:00 +0000</pubDate><atom:updated>2008-07-25T17:12:44.466+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Others</category><title>Exams Season of Tension, Isn't It?</title><description>Exams are going on, Tension is also there. But Exams should be there to test us, otherwise we''l become Lazy.....&lt;br /&gt;&lt;br /&gt;Isn't IT?</description><link>http://ashishmishra16.blogspot.com/2006/11/exams-season-of-tension-isnt-it.html</link><author>noreply@blogger.com (&lt;b&gt; Ashish Kumar Mishra&lt;/b&gt;  Location:  &lt;b&gt;Pune, India&lt;/b&gt;)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-22938274.post-115580995746345239</guid><pubDate>Thu, 17 Aug 2006 10:08:00 +0000</pubDate><atom:updated>2008-07-25T17:12:44.467+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Others</category><title>Hey Proud to be an Indian.</title><description>&lt;span style="color: rgb(0, 0, 0);font-family:courier new;font-size:130%;"  &gt;Hi day before yesterday, it was  59th Independance Day. We seen the as usual 15th august parade &amp; just enjoyed another holiday. But we r forgetting the meaning of the day. On this day, i remembered what our President said in 'Ignited Minds'. His mission of transforming India into a developed country. Youth like us need to think abt it seriously. We can do this simply by performing our duties like not paying bribes, oppose the curruption, just switching the electric equipments, by keeping our environment clean, etc. By making people aware abt their fundamental duties &amp;amp; rights. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);font-family:Courier New;font-size:130%;"  &gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);font-family:Courier New;font-size:130%;"  &gt;Everyone need to do his share of work in transforming India into a developed.  Lets make a commitment to ourself that we'll do these small things &amp; help our country. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);font-family:Courier New;font-size:130%;"  &gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);font-family:Courier New;font-size:130%;"  &gt;In this way only, we'll find true meaning of these days like 15th August, 26 Janauary, etc.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);font-family:Courier New;font-size:130%;"  &gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);font-family:Courier New;font-size:130%;"  &gt;Ok bye for now, i m coming back soon...&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);font-family:Courier New;font-size:130%;"  &gt;Ashish&lt;/span&gt;</description><link>http://ashishmishra16.blogspot.com/2006/08/hey-proud-to-be-indian.html</link><author>noreply@blogger.com (&lt;b&gt; Ashish Kumar Mishra&lt;/b&gt;  Location:  &lt;b&gt;Pune, India&lt;/b&gt;)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-22938274.post-114552424520375510</guid><pubDate>Thu, 20 Apr 2006 08:39:00 +0000</pubDate><atom:updated>2008-07-25T17:12:44.468+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Others</category><title>Exams are Boaring, Are U agree...................</title><description>Hey frens,&lt;br /&gt;&lt;br /&gt;Exams are drawing near, sleepless nights, restless days &amp; many more symptoms can be seen of examfobia.  When we talk abt exams people start reacting in abnormal ways. Why people fear from the exams. The reasons may be, know to everybody. But here are some benefits of exams i expericed  during exam periods.&lt;br /&gt;&lt;br /&gt;First , the mind start working at a great speed eg. people can pass exams with the preparation on only 15 days.&lt;br /&gt;&lt;br /&gt;Second, the subjects which are not understandable to u, are become so clear to that u start feeling that I'll teach the subject from Next Year.&lt;br /&gt;&lt;br /&gt;Many people may found another benefits of exams too, Can we share it sothat people start loving exams.. Do U think, Days like That'll come?</description><link>http://ashishmishra16.blogspot.com/2006/04/exams-are-boaring-are-u-agree.html</link><author>noreply@blogger.com (&lt;b&gt; Ashish Kumar Mishra&lt;/b&gt;  Location:  &lt;b&gt;Pune, India&lt;/b&gt;)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-22938274.post-114439494551253984</guid><pubDate>Fri, 07 Apr 2006 07:16:00 +0000</pubDate><atom:updated>2008-07-25T17:12:44.468+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Others</category><title>Believe in urself to get good Results</title><description>&lt;span style="font-family:verdana;font-size:130%;color:#cc66cc;"&gt;Hi frens,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:130%;color:#cc66cc;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:130%;color:#cc66cc;"&gt;Some time before i was always think Paper Presentaion in some National Level Paper Presenation contests is very big think. It need a lot of hard work &amp; as well as intelligence.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:130%;color:#cc66cc;"&gt;I thought at that time whether i would be able to present my own paper in such contests or not.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:130%;color:#cc66cc;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:130%;color:#cc66cc;"&gt;Few Days Back, there was such competetion in our college. My Head of Department inspired me to present a paper. He told me that i can present a perper very well. I thought &amp; accepted his offer. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:130%;color:#cc66cc;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:130%;color:#cc66cc;"&gt;I asked him about guidelines of it. I choose a topic for it &amp; started prepring for it. Also I presented in a satisfactory way.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:130%;color:#cc66cc;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:130%;color:#cc66cc;"&gt;Now I m taking part in another such compitetion, &amp; my paper is also got selected for it. Now i feel  quite good. I think it's a result of believing in myself. Nothing is impossible, if u think like this &amp; work for it.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:130%;color:#cc66cc;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:130%;color:#cc66cc;"&gt;So start beleving in urself, respect urself  &amp; love urself.........&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;</description><link>http://ashishmishra16.blogspot.com/2006/04/believe-in-urself-to-get-good-results.html</link><author>noreply@blogger.com (&lt;b&gt; Ashish Kumar Mishra&lt;/b&gt;  Location:  &lt;b&gt;Pune, India&lt;/b&gt;)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-22938274.post-114294638782111283</guid><pubDate>Tue, 21 Mar 2006 12:57:00 +0000</pubDate><atom:updated>2008-07-25T17:12:44.469+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Others</category><title>Mediataion- Knowing Urself in a Better way</title><description>&lt;span style="color:#003333;"&gt;&lt;strong&gt;Life is like fun, if u able to enjoy it. Itsn't It? We are just leaving our lives in a very careless way.Most of us are not aware of the very tiny things that are much enjoyable &amp; gives healing affects.&lt;br /&gt;Meditation makes u more siencere not serious. Some people think that meditation is  a state when u feel nothing(like sleep). But Meditation is to know urself in a batter way. Last week, i met with a person who have different kinds of mediations for different kind of problems.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#003333;"&gt;&lt;strong&gt;Two of them i know now.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#003333;"&gt;&lt;strong&gt;Such Experimentation are nice &amp; give fruitful results. But one thing is really important, before starting it, u feel that it is going to work for u. Only then u can get much benefit of it.&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#003333;"&gt;Meditate to Know the Nature &amp; Urself.&lt;/span&gt;&lt;br /&gt;&lt;/strong&gt; &lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt;</description><link>http://ashishmishra16.blogspot.com/2006/03/mediataion-knowing-urself-in-better.html</link><author>noreply@blogger.com (&lt;b&gt; Ashish Kumar Mishra&lt;/b&gt;  Location:  &lt;b&gt;Pune, India&lt;/b&gt;)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-22938274.post-114258101736411234</guid><pubDate>Fri, 17 Mar 2006 07:35:00 +0000</pubDate><atom:updated>2008-07-25T17:12:44.470+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Others</category><title/><description>&lt;span style="color:#993300;"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;Hi Frens ,&lt;br /&gt;There are things which can't be forget through out ur life like frens, fun &amp; similar many more. Friends-Few Relations In Earth Never Dies. They are like mirror where u can watch ur urself with ur cons.&lt;br /&gt;I believe personally, that everybody should have a few frens, Frens are nither Bad nor Good, They are just Frens.&lt;br /&gt;So, Can we become frens, for this I can remain ur fren for life....&lt;br /&gt;Enjoy Life, Have fun &amp;amp; Don't Forget Ur Aim......&lt;br /&gt;&lt;br /&gt;Ashish Mishra&lt;/span&gt; &lt;/span&gt;</description><link>http://ashishmishra16.blogspot.com/2006/03/hi-frens-there-are-things-which-cant.html</link><author>noreply@blogger.com (&lt;b&gt; Ashish Kumar Mishra&lt;/b&gt;  Location:  &lt;b&gt;Pune, India&lt;/b&gt;)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-22938274.post-114250660087482971</guid><pubDate>Thu, 16 Mar 2006 10:45:00 +0000</pubDate><atom:updated>2008-07-25T17:12:44.470+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Others</category><title>Holi- How Was It?</title><description>&lt;strong&gt;&lt;span style="color:#993300;"&gt;Hi frens,&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#993300;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#993300;"&gt;Yesterday, We celebrated the Holi, It's is known as festival of colors, Colors of joy, happiness, prosparity, victory , etc. &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#993300;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#993300;"&gt;The craze of this festival is decreasing year after year, can somebody tell me about the reason behind it?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#993300;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#993300;"&gt;What i had found, that people are no more interested in such festivals. It because of  the environment &amp; way of celebrating are not worthy. People user dark colors which are bad in quality &amp;amp; chemicals. Some people use synthetic paints, mud etc.&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#993300;"&gt;Such things are really disgusting.&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#993300;"&gt; Such things are hurting the feeling of people, &amp; should be avoided.&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#993300;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#993300;"&gt;Then people'll will able to celebrate Holi with joy &amp; delight.&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#993300;"&gt;&lt;/span&gt;&lt;/strong&gt;</description><link>http://ashishmishra16.blogspot.com/2006/03/holi-how-was-it.html</link><author>noreply@blogger.com (&lt;b&gt; Ashish Kumar Mishra&lt;/b&gt;  Location:  &lt;b&gt;Pune, India&lt;/b&gt;)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-22938274.post-114164259414070379</guid><pubDate>Mon, 06 Mar 2006 10:36:00 +0000</pubDate><atom:updated>2008-07-25T17:12:44.471+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Others</category><title>Have U Seen My Web-site</title><description>&lt;span style="color:#ff6666;"&gt;Hi friends,&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff6666;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff6666;"&gt;I had just uploaded my web pages at &lt;/span&gt;&lt;a href="http://www.geocities.com/ashish4u4ever2003"&gt;&lt;span style="color:#ff6666;"&gt;www.geocities.com/ashish4u4ever2003&lt;/span&gt;&lt;/a&gt;&lt;span style="color:#ff6666;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff6666;"&gt;It's was fun, i found it very easy. Now i m feeling quite relaxed. I had broken my promise to my senior, that i will upload my web-page is 15 days, I m really sorry for it, Kuldeep Sir. &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff6666;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff6666;"&gt;But i am still thinking that he can forget me for this, since i had done in after 2 days, of given deadline.&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff6666;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff6666;"&gt;I had  created six pages, but they are not complete still, two pages are still not fully complete.&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff6666;"&gt;I had tried hard for it, please watch it, and send me the response on my mail&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff6666;"&gt;&lt;a href="mailto:ashish.mishra16@gmail.com"&gt;ashish.mishra16@gmail.com&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff6666;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff6666;"&gt;ur fren&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff6666;"&gt;Ashish Mishra&lt;/span&gt;</description><link>http://ashishmishra16.blogspot.com/2006/03/have-u-seen-my-web-site.html</link><author>noreply@blogger.com (&lt;b&gt; Ashish Kumar Mishra&lt;/b&gt;  Location:  &lt;b&gt;Pune, India&lt;/b&gt;)</author><thr:total>0</thr:total></item></channel></rss>