<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1246487936314048633</id><updated>2011-12-04T00:58:12.474+05:30</updated><category term='Help In Need Is A Help Indeed'/><category term='Ubuntu'/><category term='LINKS EXCHANGE'/><category term='BLOG&apos;s OBJECTIVE'/><category term='Preparing For Certification'/><category term='Good Health'/><category term='Java'/><category term='J2EE-Patterns'/><category term='J2EE'/><category term='Java Quiz'/><category term='ABOUT ME'/><category term='Information Is Wealth'/><title type='text'>Help To The Needed.</title><subtitle type='html'>An Initiative To Open One's Mind and Thoughts...</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>63</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-8141067226721145457</id><published>2011-12-04T00:25:00.004+05:30</published><updated>2011-12-04T00:40:27.046+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='J2EE-Patterns'/><title type='text'>Classic Singleton example</title><content type='html'>&lt;div&gt;A classic and fool-proof example of Singleton sample is as follows,&lt;br /&gt;&lt;br /&gt;Considering that we need to create a singleton for an Employee object(some POJO, for easier understanding), a Singleton can be expressed as,&lt;br /&gt;&lt;br /&gt;class SampleSingleton{&lt;br /&gt;      private static Employee empObject= new Employee();&lt;br /&gt;      public static Employee getEmployee(){&lt;br /&gt;             return empObject;&lt;br /&gt;      }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;On start up, I create a singleton object and assign it to the empObject, and each time I only send that single object to the caller.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-8141067226721145457?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/8141067226721145457/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=8141067226721145457&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/8141067226721145457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/8141067226721145457'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2011/12/classic-singleton-example.html' title='Classic Singleton example'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-4384951637612393835</id><published>2011-08-04T17:38:00.005+05:30</published><updated>2011-08-04T17:42:46.086+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Deadlock via Threads sample</title><content type='html'>A sample demonstration of deadlock.&lt;br /&gt;Here it goes.&lt;br /&gt;&lt;br /&gt;public class DeadlockSample {&lt;br /&gt;   &lt;br /&gt;    public static void main(String[] args) {&lt;br /&gt;        final DeadlockSample d = new DeadlockSample();&lt;br /&gt;        final DeadlockSample d1 = new DeadlockSample();&lt;br /&gt;        Thread t1 = new Thread() {&lt;br /&gt;            public void run() {&lt;br /&gt;                System.out.println("Thread t1 before entering synchronized block d");&lt;br /&gt;                synchronized (d) {&lt;br /&gt;                    System.out.println("Thread 1: locked d");&lt;br /&gt;&lt;br /&gt;                    try {&lt;br /&gt;                        Thread.sleep(50);&lt;br /&gt;                    } catch (InterruptedException e) {&lt;br /&gt;                    }&lt;br /&gt;                    System.out.println("Thread t1 before entering synchronized block d1");&lt;br /&gt;                    synchronized (d1) {&lt;br /&gt;                        System.out.println("Thread 1: locked d1");&lt;br /&gt;                    }&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        };&lt;br /&gt;&lt;br /&gt;        Thread t2 = new Thread() {&lt;br /&gt;            public void run() {&lt;br /&gt;                System.out.println("Thread t2 before entering synchronized block d1");&lt;br /&gt;                synchronized (d1) {&lt;br /&gt;                    System.out.println("Thread 2: locked d1");&lt;br /&gt;&lt;br /&gt;                    try {&lt;br /&gt;                        Thread.sleep(50);&lt;br /&gt;                    } catch (InterruptedException e) {&lt;br /&gt;                    }&lt;br /&gt;                    System.out.println("Thread t2 before entering synchronized block d");&lt;br /&gt;                    synchronized (d) {&lt;br /&gt;                        System.out.println("Thread 2: locked d");&lt;br /&gt;                    }&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        };&lt;br /&gt;        t1.start();&lt;br /&gt;        t2.start();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;On execution,&lt;br /&gt;&lt;br /&gt;Thread t1 before entering synchronized block d&lt;br /&gt;Thread 1: locked d&lt;br /&gt;Thread t2 before entering synchronized block d1&lt;br /&gt;Thread 2: locked d1&lt;br /&gt;Thread t1 before entering synchronized block d1&lt;br /&gt;Thread t2 before entering synchronized block d&lt;br /&gt;&lt;br /&gt;and the program goes into a deadlock. Each Thread waits for the other to complete.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-4384951637612393835?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/4384951637612393835/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=4384951637612393835&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/4384951637612393835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/4384951637612393835'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2011/08/deadlock-via-threads-sample.html' title='Deadlock via Threads sample'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-8707538526823120649</id><published>2011-02-16T17:04:00.005+05:30</published><updated>2011-02-16T17:13:38.054+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>JDK, Ant and Tomcat6 installation in ubuntu</title><content type='html'>Hi,&lt;br /&gt;&lt;br /&gt;Before a new installation  is to be done, I prefer to un install the previous versions.&lt;br /&gt;&lt;br /&gt;Open your Terminal(alt + shift + T) and do the following&lt;br /&gt;&lt;br /&gt;first remove any previous versions of java using the&lt;br /&gt;&lt;br /&gt;"sudo apt-get remove sun-java6-" command.&lt;br /&gt;&lt;br /&gt;Than to install a new version of java,&lt;br /&gt;&lt;br /&gt;type in&lt;br /&gt;&lt;br /&gt;"sudo apt-get install sun-java6-jdk"&lt;br /&gt;&lt;br /&gt;Type Y if prompted for Do u want to continue..&lt;br /&gt;&lt;br /&gt;This is the preferred jdk to work on.&lt;br /&gt;&lt;br /&gt;java Plugins can be added using the "sudo apt-get install sun-java6-plugin " command&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If we need to install ant, just enter "sudo apt-get install ant"&lt;br /&gt;&lt;br /&gt;Type Y if prompted for Do u want to continue..&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To Install tomcat6,&lt;br /&gt;&lt;br /&gt;the command to be used is "sudo apt-get install tomcat6"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Cheers :D&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-8707538526823120649?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/8707538526823120649/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=8707538526823120649&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/8707538526823120649'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/8707538526823120649'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2011/02/jdk-installation-in-ubuntu.html' title='JDK, Ant and Tomcat6 installation in ubuntu'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-3247286454883017939</id><published>2011-02-10T22:12:00.002+05:30</published><updated>2011-02-10T22:52:24.882+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Help In Need Is A Help Indeed'/><title type='text'>Load Testing Tool For GWT</title><content type='html'>&lt;div&gt;Long time no see......&lt;/div&gt;&lt;div&gt;Wondering what I was doing so long??&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Well, lot of changes, actually..&lt;div&gt;I have moved over to using Ubuntu from Windows, and currently I am working on web app development using GWT, Spring and Hibernate.&lt;/div&gt;&lt;div&gt;Post application development, it's now the season of Testing!&lt;br /&gt;&lt;div&gt;&lt;div&gt;Currently, I am on  the lookout of a Load Testing tool for GWT.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Though there are tools out there in the web, search for a Load testing tool that uses GWT that supports Linux is getting more difficult each day..&lt;/div&gt;&lt;div&gt;This is my current status! &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Friends, In case you come across any Load testing tool, let me know.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;!!! HELP TO THE NEEDED !!!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-3247286454883017939?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/3247286454883017939/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=3247286454883017939&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/3247286454883017939'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/3247286454883017939'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2011/02/load-testing-tool-for-gwt.html' title='Load Testing Tool For GWT'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-3200128638900038820</id><published>2010-07-05T14:02:00.002+05:30</published><updated>2011-12-04T00:40:27.054+05:30</updated><title type='text'>MVC Design Pattern</title><content type='html'>&lt;div&gt;Originated from Smalltalk, MVC stands for Model-View-Controller.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;Model:&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Denotes the data objects, model comprises of everything that's being modified and presented to the user.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;View:&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;View is the screen representation of the model. The current state of the data objects is presented using this object.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;Controller:&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Controller defines the way the User Interface reacts o the input given by the user. the data objects (Model) is manipulated using the Controller component.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;Benefits of using the MVC:&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Reliability(Clear seperation between the presentation and transaction layers)&lt;/div&gt;&lt;br /&gt;&lt;div&gt;High reuse and Adaptability(Multiple types of views can be used with the same server-side code)&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Very low development and life Cycle costs:(Even low level programmers can develop and maintain the UI)&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Rapid Deployment:(Development time can be reduced as UI designers focus)&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-3200128638900038820?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/3200128638900038820/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=3200128638900038820&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/3200128638900038820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/3200128638900038820'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2010/07/mvc-design-pattern.html' title='MVC Design Pattern'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-7104769628708448160</id><published>2010-05-11T14:07:00.008+05:30</published><updated>2010-05-11T14:36:57.285+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='J2EE'/><title type='text'>CGI and Advantages Of Java Servlets Over Perl</title><content type='html'>&lt;strong&gt;CGI:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;There are two things a Web Server Application alone can't do:&lt;br /&gt;1) Generate Dynamic Content (generating dynamic / on-the-fly web pages)&lt;br /&gt;2) Perform Operations with form Data.&lt;br /&gt;To perform these operations, the web server application uses &lt;strong&gt;helper applications&lt;/strong&gt;.&lt;br /&gt;These helper Applications perform the operations and sends information back to the web server application. (The web server application thinks that the page received is just another static page.)&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;The non-Java term for the helper application is CGI(Common Gateway Interface).&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Most CGI programs were written using Perl and now I would like to bring out the advantages of Java over Perl.&lt;br /&gt;* Java is Performance effective. With Perl, the server has to launch a heavy weight process for each and every request for that resource.&lt;br /&gt;* Now we might get a thought that similarly in Java, each instance of the JVM would be a heavy weight process.&lt;br /&gt;* In our case, Servlets stay loaded only once. Client requests for a servlet resource are handled as seperate &lt;strong&gt;&lt;em&gt;Threads &lt;/em&gt;&lt;/strong&gt;of the single running Servlet. We don't have the overhead of starting the JVM and loading the class.&lt;br /&gt;* It can be pointed out that Web servers are able to keep a single Perl program running between clients, but, the point is not all web servers can do that. It's a special case which doesn't apply to all Perl CGI programs.&lt;br /&gt;* Furthermore, Servlets can be a J2EE Client, whereas a Perl CGI Program cannot!&lt;br /&gt;&lt;br /&gt;More to be discussed with respect to J2EE Clients.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-7104769628708448160?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/7104769628708448160/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=7104769628708448160&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/7104769628708448160'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/7104769628708448160'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2010/05/cgi-advantages-of-java-servlets-over.html' title='CGI and Advantages Of Java Servlets Over Perl'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-2073789010000613776</id><published>2010-05-11T11:05:00.002+05:30</published><updated>2010-05-11T11:11:35.847+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='J2EE'/><title type='text'>What's a MIME type</title><content type='html'>The &lt;b&gt;Content-Type &lt;/b&gt;response header's value in the HTTP Response is known as MIME type.&lt;div&gt;The MIME type tells the browser what kind of data the browser is about to receive so that the browser will know how to render that. The MIME type is any of the types sent in the HTTP Request's "&lt;b&gt;Accept:&lt;/b&gt;" Header.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Example: &lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the HTTP POST Request, if we have&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/&lt;/div&gt;&lt;div&gt;plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Content-Type: text/html&lt;/div&gt;&lt;div&gt;is the possible MIME type sent using the HTTP Response.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-2073789010000613776?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/2073789010000613776/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=2073789010000613776&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/2073789010000613776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/2073789010000613776'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2010/05/whats-mime-type.html' title='What&apos;s a MIME type'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-1985668630545758475</id><published>2010-03-05T09:59:00.004+05:30</published><updated>2010-03-05T10:25:46.636+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Some Beautiful Web UI Options</title><content type='html'>I was on the look out for interesting and beautiful Web UI libraries for creating Rich Internet Applications, and I came across few options...&lt;br /&gt;&lt;br /&gt;I need to explore it further and try out samples...&lt;br /&gt;&lt;br /&gt;I would like to list the various options and give a brief idea based upon information collected online.&lt;br /&gt;If readers have come across any of those technologies, they could gladly join in.&lt;br /&gt;&lt;br /&gt;1. &lt;a href="http://vaadin.com/home"&gt;IT Mill Toolkit&lt;/a&gt; (Now Called as Vaadin)&lt;br /&gt;IT Mill Toolkit is an open-source framework, providing widgets and tools for the development of Rich Internet Applications (RIAs). Delivers web applications without worrying about incompatibilities of web browsers, DOM or JavaScript by using standard Java tools.&lt;br /&gt;&lt;br /&gt;2. &lt;a href="http://livepipe.net/"&gt;LivePipe UI &lt;/a&gt;&lt;br /&gt;LivePipe UI is a suite of high quality widgets and controls for web 2.0 applications built using the Prototype JavaScript Framework. Each control is well tested, highly extensible, fully documented and degrades gracefully for non JavaScript enabled browsers where possible&lt;br /&gt;&lt;br /&gt;3. &lt;a href="http://www.jitsu.org/"&gt;Jitsu &lt;/a&gt;&lt;br /&gt;Jitsu contains an integrated set of tools to enable developers to build and deploy sophisticated user interfaces for web applications. These include an Xml markup language, page compiler, data binding engine, JavaScript runtime, control library, runtime inspector, animation engine, cross-platform library, Ajax, and back button support.&lt;br /&gt;&lt;br /&gt;4. &lt;a href="http://mochaui.com/"&gt;MochaUI&lt;/a&gt;&lt;br /&gt;MochaUI is a web applications user interface library built on the Mootools JavaScript framework.Uses: web applications, web desktops, web sites, widgets, standalone windows and modal dialogs.&lt;br /&gt;&lt;br /&gt;5. &lt;a href="http://echo.nextapp.com/site/"&gt;Echo Web Framework &lt;/a&gt;&lt;br /&gt;Echo is an open-source framework for developing rich web applications. From the developer's perspective, Echo behaves as a user interface toolkit--like Swing or Eclipse SWT. AJAX technology is employed to deliver a user experience to web clients that approaches that of desktop-based applications.&lt;br /&gt;&lt;br /&gt;6. &lt;a href="http://developer.yahoo.com/yui/"&gt;The Yahoo! User Interface Library (YUI) &lt;/a&gt;&lt;br /&gt;The YUI Library is a set of utilities and controls, written in JavaScript, for building richly interactive web applications using techniques such as DOM scripting, DHTML and AJAX. YUI is available under a BSD license and is free for all uses.&lt;br /&gt;&lt;br /&gt;7. &lt;a href="http://wui.sourceforge.net/wui-overview.php"&gt;WUI Web UI Framework &lt;/a&gt;&lt;br /&gt;WUI (Web User Interface) is an MVC framework for writing web UIs in a single language: Java. Write web apps with components, widgets &amp;amp; events, not JSPs. Runs in any servlet 2.3 container. Similar to Model 2 / Struts, only better. Apache-style license.&lt;br /&gt;&lt;br /&gt;8. &lt;a href="http://butterfly.jenkov.com/webui/index.html"&gt;Butterfly Web UI &lt;/a&gt;&lt;br /&gt;Butterfly Web UI is a component oriented web framework for Java, like Wicket or Tapestry. The main advantage compared to these frameworks is that Butterfly Web UI integrates naturally with Butterfly DI Container, giving you a state-of-the-art dependency injection container to help you structure and decouple the internal components of your web applications.&lt;br /&gt;&lt;br /&gt;Apart from the above, we also have &lt;a href="http://code.google.com/webtoolkit/overview.html"&gt;GWT&lt;/a&gt;, &lt;a href="http://jquery.com/"&gt;JQuery &lt;/a&gt;and &lt;a href="http://www.extjs.com/"&gt;Extjs&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Information is wealth.. Kindly add information for better understanding of readers.&lt;br /&gt;If you have samples, you can mail it to me at&lt;br /&gt;&lt;a href="mailto:s.its.chandru@gmail.com"&gt;s.its.chandru@gmail.com&lt;/a&gt;.&lt;br /&gt;I will ensure, it appears here under your name&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-1985668630545758475?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/1985668630545758475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=1985668630545758475&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/1985668630545758475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/1985668630545758475'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2010/03/some-beautiful-web-ui-options.html' title='Some Beautiful Web UI Options'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-409442936764465395</id><published>2009-10-05T10:11:00.002+05:30</published><updated>2009-10-05T10:28:20.828+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='J2EE'/><title type='text'>J2EE Class -2</title><content type='html'>&lt;span style="font-weight:bold;"&gt;WEB BROWSER AND WEB SERVER:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;* A web browser lets a user to request a resource. &lt;br /&gt;&lt;br /&gt;* The web server gets the request, finds the resource, and returns something back to the user. The returned resource can be a HTML page, a picture, a sound file or even a PDF document. The client asks for the resource and the server sends it back.&lt;br /&gt;&lt;br /&gt;In short, &lt;span style="font-weight:bold;"&gt;A web server takes a client request and gives something back to the client.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;REASONS A WEB SERVER DOESN'T SEND A RESOURCE:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;* A server doesn't send a resource if its not there, or even if it’s not where the server is expecting it to be. "&lt;span style="font-weight:bold;"&gt;404 Not Found&lt;/span&gt;" is the error response you get when the server can’t find what we asked for.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;WEB CLIENT:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;* Clients mean both (or either) the human user and the browser application.&lt;br /&gt;&lt;br /&gt;* The browser is the piece of software (like Netscape or Mozilla) that knows how to communicate with the server. The browser’s other big job is interpreting the HTML code and rendering the web page for the user.&lt;br /&gt;&lt;br /&gt;* The client is the browser application doing what the user asked it to do.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;FUNCTIONALITY OF A WEB CLIENT:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A web client lets the user &lt;span style="font-weight:bold;"&gt;request&lt;/span&gt; something on the server, and shows the user the &lt;span style="font-weight:bold;"&gt;result&lt;/span&gt; of the request.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;CLIENTS AND SERVERS COMMUNICATE USING HTML and HTTP.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;HTML(HyperText Markup Language):&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When a server answers a request,the server usually sends some type of content to the browser so that the browser can display it. Servers often send the browser a set of instructions written in HTML. The HTML tells the browser how to present the content to the user. All web browsers know what to do with HTML, although sometimes an older browser might not understand parts of a page that was written using newer versions of HTML.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;HTTP(HyperText Transfer Protocol):&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Most of the conversations held on the web between clients and servers are held using the HTTP protocol, which allows for simple request and response conversations. The client sends an HTTP request, and the server answers with an HTTP response. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;HTML and HTTP IN SHORT:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;if you’re a web server, you speak HTTP.&lt;br /&gt;When a web server sends an HTML page to the client, it sends it using HTTP. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-409442936764465395?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/409442936764465395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=409442936764465395&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/409442936764465395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/409442936764465395'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/10/j2ee-class-2.html' title='J2EE Class -2'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-701637492066049832</id><published>2009-09-30T10:04:00.002+05:30</published><updated>2009-09-30T10:14:45.037+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='J2EE'/><title type='text'>J2EE Class -1</title><content type='html'>Dear friends,&lt;br /&gt;&lt;br /&gt;From today I would also like to focus on J2EE concepts.&lt;br /&gt;&lt;br /&gt;What all you need to learn:&lt;br /&gt;&lt;br /&gt;Besides your brain and a pencil, you also need Java, Tomcat 5, and a&lt;br /&gt;computer.You do not need any Integrated Development Environment like Eclipse, etc. I strongly recommend you, not to use anything but a basic editor until you complete the J2EE tutorial.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;GETTING THE SOFTWARE&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;* If you don’t already Java SE v1.5 or greater, you’ll need it.&lt;br /&gt;&lt;br /&gt;* If you don’t already have Tomcat 5, go get it from:&lt;span style="font-weight:bold;"&gt;http://tomcat.apache.org/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;* Select "Tomcat v5.5" in the Downloads menu on the left side of the home page.&lt;br /&gt;&lt;br /&gt;* Scroll down to the "Binary Distributions" section and download the version of your&lt;br /&gt;choice. If you do not know, then select the "Core" distribution; it is all you need.&lt;br /&gt;&lt;br /&gt;* Save the installation file in a temporary directory.&lt;br /&gt;&lt;br /&gt;* Install Tomcat.&lt;br /&gt;&lt;br /&gt;   --&gt; For Windows, that means double-clicking the install.exe file and following the&lt;br /&gt;   installer wizard instructions.&lt;br /&gt;&lt;br /&gt;   --&gt; For the others, unpack the install file into the place on your hard drive   &lt;br /&gt;   where you want Tomcat to be.&lt;br /&gt;&lt;br /&gt;* To make it easier to follow the book instructions, name the Tomcat home directory&lt;br /&gt;"tomcat".&lt;br /&gt;&lt;br /&gt;* Set environment variables for JAVA_HOME and TOMCAT_HOME.&lt;br /&gt;&lt;br /&gt;Test Tomcat by launching the tomcat/bin/startup script (which is startup.sh) for&lt;br /&gt;Linux/Unix/OS X. Point your browser to:&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;http://localhost:8080/&lt;/span&gt; and you’ll see the Tomcat welcome page.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-701637492066049832?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/701637492066049832/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=701637492066049832&amp;isPopup=true' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/701637492066049832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/701637492066049832'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/09/j2ee-class-1.html' title='J2EE Class -1'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-6055598608635419154</id><published>2009-09-29T10:06:00.003+05:30</published><updated>2009-09-29T10:35:09.772+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>The To String method</title><content type='html'>&lt;span style="font-weight:bold;"&gt;The toString() Method&lt;/span&gt; Override toString() when we want to read something meaningful about the objects of our class. Code can call toString() on our object when it wants to read useful details about our object. &lt;br /&gt;&lt;br /&gt;To be more clear, Now when we pass an object reference to the System.out.println() method, and for example, the object's toString() method is called as follows,&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;public class ClassA {&lt;br /&gt;   public static void main (String [] args) {&lt;br /&gt;     ClassA classA = new ClassA();&lt;br /&gt;     System.out.println(classA);&lt;br /&gt;   }&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;then, Running the ClassA class gives us the following output,&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;% Java ClassA&lt;br /&gt;ClassA@10b62c9&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The above output is what we get when we don't override the toString() method of class Object. It gives us the class name (at least that's meaningful) followed by the @ symbol, followed by the unsigned hexadecimal representation of the object's hashcode.&lt;br /&gt;&lt;br /&gt;Trying to read this output might motivate us to override the toString() method in our classes, for example,&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;public class ClassA {&lt;br /&gt;   public static void main (String[] args) {&lt;br /&gt;      ClassB classB = new ClassB("Test the toString method", new Date());&lt;br /&gt;      System.out.println(classB);&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;class ClassB {&lt;br /&gt;   Date data1;&lt;br /&gt;   String data2;&lt;br /&gt;   ClassB(String data2, Date data1) {&lt;br /&gt;   this.data1 = data1;&lt;br /&gt;   this.data2 = data2;&lt;br /&gt;   }&lt;br /&gt;   public String toString() {&lt;br /&gt;      return ("The main aim of this program is to " + data2 +&lt;br /&gt;              ". This program was written on " + data1);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;The output of this would be a bit more readable:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;% Java ClassA&lt;br /&gt;The main aim of this program is to Test the toString method. This program was written on Tue Sep 29 10:26:59 IST 2009&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For your Information, Some people refer the toString() method as the "spill-your-guts method," since the most common implementations of toString() simply tell us the object's state.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-6055598608635419154?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/6055598608635419154/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=6055598608635419154&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/6055598608635419154'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/6055598608635419154'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/09/to-string-method.html' title='The To String method'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-7368906416704479287</id><published>2009-09-24T09:59:00.007+05:30</published><updated>2009-10-12T08:41:52.882+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='LINKS EXCHANGE'/><title type='text'>LINKS EXCHANGE</title><content type='html'>Dear friends,&lt;br /&gt;&lt;br /&gt;Check for your links here, If you dont find them here, then I would be really pleased to share links with you.&lt;br /&gt;&lt;br /&gt;Currently blog is under updation,&lt;br /&gt;If you miss your link in my friends list kindly shout in my SHOUT BOX. I will add you.&lt;br /&gt;Sorry for the inconvinience.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.4feb.blogspot.com/"&gt;4 Feb&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.9xhot.info/"&gt;9 X Hot&lt;/a&gt;&lt;br /&gt;&lt;a href="http://aim-mba.blogspot.com/"&gt;Aim – Mba&lt;/a&gt;&lt;br /&gt;&lt;a href="http://allakom.blogspot.com/"&gt;All about Computers&lt;/a&gt;&lt;br /&gt;&lt;a href="http://applicationsandsoftwares.blogspot.com/"&gt;Applications And Softwares&lt;/a&gt;&lt;br /&gt;&lt;a href="http://assassinscreed00.blogspot.com/"&gt;Assasins&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.awake-studio.com/"&gt;Awake Studio&lt;/a&gt;&lt;br /&gt;&lt;a href="http://beautiful-tourist-places.blogspot.com/"&gt;Beautiful Tourist Places&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.comijam.org/"&gt;Comijam&lt;/a&gt;&lt;br /&gt;&lt;a href="http://communicatebetter.blogspot.com/2008/05/my-links.html"&gt;Communicate Better&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.aceptamostutarjeta.com/"&gt;Computer Technology and Entertainment&lt;/a&gt;&lt;br /&gt;&lt;a href="http://cookieroa-18.blogspot.com/"&gt;Cookie&lt;/a&gt;&lt;br /&gt;&lt;a href="http://cooltafreeh.blogspot.com/"&gt;Cool Tafreeh&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ctexpeditions.com/"&gt;Ctexpeditions&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dayoday.blogspot.com/"&gt;Day O Day&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.downloadgratis34.blogspot.com/"&gt;Download Gratis34&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dwisusilo.com/index.php/link-x-change"&gt;Dwisusilo&lt;/a&gt;&lt;br /&gt;&lt;a href="http://e-browse.info/"&gt;E- Browse&lt;/a&gt;&lt;br /&gt;&lt;a href="http://earnmoneyfromads.blogspot.com/"&gt;Earn Money From Ads&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.edublawg.com/"&gt;Edublawg&lt;/a&gt;&lt;br /&gt;&lt;a href="http://ekaputriani.blogspot.com/"&gt;Ekaputriani&lt;/a&gt;&lt;br /&gt;&lt;a href="http://fashions-funda.blogspot.com/"&gt;Fashions-Funda&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www-fastdiet.com/links/"&gt;Fast Diet&lt;/a&gt;&lt;br /&gt;&lt;a href="http://fraudmamy.blogspot.com/"&gt;Fraud Mamy&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.gamereview2u.co.cc/"&gt;Game Review 2 U&lt;/a&gt;&lt;br /&gt;&lt;a href="http://games4x.blogspot.com/2008/04/link-banner-games.html"&gt;Games 4x&lt;/a&gt;&lt;br /&gt;&lt;a href="http://gamezconsole.blogspot.com/"&gt;Gamez Console&lt;/a&gt;&lt;br /&gt;&lt;a href="http://gearsofwar8081.blogspot.com/"&gt;Gears Of War 8081&lt;/a&gt;&lt;br /&gt;&lt;a href="http://gratis-ebooks.blogspot.com/2009/05/link-exchange.html"&gt;Gratis-Ebooks&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hobbychaos.blogspot.com/"&gt;Hobby Chaos&lt;/a&gt;&lt;br /&gt;&lt;a href="http://huihuiakatara.blogspot.com/"&gt;Huihuiakatara&lt;/a&gt;&lt;br /&gt;&lt;a href="http://ilalangpagi.blogspot.com/2009/07/links-exchange-friends.html"&gt;Ilalangpagi&lt;/a&gt;&lt;br /&gt;&lt;a href="http://indianrocksstar.blogspot.com/"&gt;Indian Rocks Star&lt;/a&gt; &lt;br /&gt;&lt;a href="http://www.indoblogster.com/"&gt;Indo Blogster&lt;/a&gt; &lt;br /&gt;&lt;a href="http://infoabtworld.blogspot.com/"&gt;Info Abt World&lt;/a&gt;&lt;br /&gt;&lt;a href="http://infobyvicky.blogspot.com/"&gt;Info By Vicky&lt;/a&gt;&lt;br /&gt;&lt;a href="http://kooooltime.blogspot.com/"&gt;Kooool Time&lt;/a&gt;&lt;br /&gt;&lt;a href="http://kungfupanda81.blogspot.com/"&gt;Kung fu Panda81&lt;/a&gt;&lt;br /&gt;&lt;a href="http://liezl-read-write.blogspot.com/"&gt;Liezl Read Write&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ligayascorner.com/"&gt;Ligaya's Corner&lt;/a&gt;&lt;br /&gt;&lt;a href="http://meinthedutchsociety.blogspot.com/"&gt;Me In The Dutch Society&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.medicalcravings.com/"&gt;Medical Cravings&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.mimo9.com/"&gt;Mimo 9&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mrilham.com/link-exchange/"&gt;Mrilham&lt;/a&gt;&lt;br /&gt;&lt;a href="http://musicandmovienews.blogspot.com/"&gt;Music And Movie News&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.myfashionlink.com/"&gt;My Fashion Link&lt;/a&gt;&lt;br /&gt;&lt;a href="http://emie-myrecollection.blogspot.com/"&gt;My Recollection&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.mygossipgirl.com/"&gt;My Gossip Girl&lt;/a&gt;&lt;br /&gt;&lt;a href="http://nadahima2.blogspot.com/"&gt;Nadahima2&lt;/a&gt;&lt;br /&gt;&lt;a href="http://newyorkvisitor.blogspot.com/"&gt;New York Visitor&lt;/a&gt;&lt;br /&gt;&lt;a href="http://niceevents.blogspot.com/"&gt;Nice Events&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.nicethoughtsnthrills.blogspot.com/"&gt;Nice Thoughts n Thrills&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ourvotematters08.org/"&gt;Our Vote Matters08&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.pacrim-entertainment.com/"&gt;Pacrim-Entertainment&lt;/a&gt;&lt;br /&gt;&lt;a href="http://purebloodrayne.blogspot.com/"&gt;Pure Blood Rayne&lt;/a&gt;&lt;br /&gt;&lt;a href="http://reeyou36.blogspot.com/"&gt;Reeyou36&lt;/a&gt;&lt;br /&gt;&lt;a href="http://runeupload.net/"&gt;Rune Upload&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.singlemomthoughts.com/"&gt;Single Mom Thoughts&lt;/a&gt;&lt;br /&gt;&lt;a href="http://shalinisamuel.blogspot.com/"&gt;Shalini Samuel&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.socketshield.com/"&gt;Socket Shield&lt;/a&gt;&lt;br /&gt;&lt;a href="http://specialfoodworld.blogspot.com/"&gt;Special Food World&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.studentsexclusive.co.cc/"&gt;Students Exclusive&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.suresh.myjoyz.com/"&gt;Suresh My Joyz&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.tamilcs.blogspot.com/"&gt;Tamil CS&lt;/a&gt;&lt;br /&gt;&lt;a href="http://tamilthrill.com/"&gt;Tamil Thrill&lt;/a&gt;&lt;br /&gt;&lt;a href="http://taskcricket.blogspot.com/"&gt;Task Cricket&lt;/a&gt;&lt;br /&gt;&lt;a href="http://theglimpseofart.blogspot.com/"&gt;The Glimpse Of Art&lt;/a&gt;&lt;br /&gt;&lt;a href="http://capbc.org"&gt;The TECH Repository&lt;/a&gt;&lt;br /&gt;&lt;a href="http://thusoftcom.blogspot.com/2009/08/studio-matematika-math-studio.html"&gt;Thu Soft Com&lt;/a&gt;&lt;br /&gt;&lt;a href="http://tutorial-tip-trik.blogspot.com/"&gt;Tutorial-Tip-Trik&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.twinscolumn.com/"&gt;Twins Column&lt;/a&gt;&lt;br /&gt;&lt;a href="http://vijaikiran.blogspot.com/"&gt;Vijay Kiran&lt;/a&gt;&lt;br /&gt;&lt;a href="http://virtualbuzz.blogspot.com/"&gt;Virtual Buzz&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.sktesabajang.co.cc/link-me"&gt;Web World&lt;/a&gt;&lt;br /&gt;&lt;a href="http://welcomemynewblog.blogspot.com/"&gt;Welcome My New Blog&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.wildtusker.blogspot.com/"&gt;Wild Tusker&lt;/a&gt;&lt;br /&gt;&lt;a href="http://whenmymindtrytospeak.blogspot.com/"&gt;When My Mind Try To Speak&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.yourlocalgallery.com/"&gt;Your Local Gallery&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.zeethru.co.cc/"&gt;Zeethru&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-7368906416704479287?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/7368906416704479287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=7368906416704479287&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/7368906416704479287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/7368906416704479287'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/09/links-exchange_24.html' title='LINKS EXCHANGE'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-2286452005857559817</id><published>2009-09-23T11:10:00.001+05:30</published><updated>2009-09-23T11:10:34.612+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='ABOUT ME'/><title type='text'>ABOUT ME</title><content type='html'>I am a cool and an optimistic person hungry for achievements with a burning desire for knowledge transfer to help others by getting helped. If you prefer to hear from me, please feel free and contact me at s.its.chandru@gmail.com&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-2286452005857559817?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/2286452005857559817/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=2286452005857559817&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/2286452005857559817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/2286452005857559817'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/09/about-me.html' title='ABOUT ME'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-6958451524788954639</id><published>2009-09-23T10:38:00.000+05:30</published><updated>2009-09-23T10:39:27.324+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='BLOG&apos;s OBJECTIVE'/><title type='text'>BLOG's OBJECTIVE</title><content type='html'>The main Objective Of the Blog is to share everything that I want to share with my readers.The Blog is a repository Of Facts, Health, and most importantly it focuses on Java. Java is a technology which always has something new to offer, no matter how many websites are launched to share it. So, through this blog, I would like to share my Java Experience and supported aptly by Java Quizzes, this is a Repository Of Knowledge which Helps everyone in need in some way or other.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-6958451524788954639?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/6958451524788954639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=6958451524788954639&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/6958451524788954639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/6958451524788954639'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/09/blogs-objective.html' title='BLOG&apos;s OBJECTIVE'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-6842663086604660622</id><published>2009-09-22T09:13:00.003+05:30</published><updated>2009-09-22T09:56:04.612+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Quiz'/><title type='text'>Java Quiz -17</title><content type='html'>Hi friends, &lt;br /&gt;&lt;br /&gt;Today I would like to post few more questions to test your capability. &lt;br /&gt;Dont worry guys, I will give you the answer too! Try to answer it yourself without referring to the answers to test yourself.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 1 Given a valid DateFormat object named df, and&lt;br /&gt;1. Date data1 = new Date(0L);&lt;br /&gt;2. String data2 = "September 22, 2009";&lt;br /&gt;3. // insert code here&lt;br /&gt;What updates data1's value with the date represented by data2?&lt;/span&gt;&lt;br /&gt;A. 3. data1 = df.parse(data2);&lt;br /&gt;B. 3. data1 = df.getDate(data2);&lt;br /&gt;C. 3. try {&lt;br /&gt;   4. data1 = df.parse(data2);&lt;br /&gt;   5. } catch(ParseException e) { };&lt;br /&gt;D. 3. try {&lt;br /&gt;   4. data1 = df.getDate(data2);&lt;br /&gt;   5. } catch(ParseException e) { };&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: C&lt;br /&gt;&lt;br /&gt;Q: 2 Given:&lt;br /&gt;1. public class ClassA {&lt;br /&gt;2. private StringBuilder testStringBuilder = new StringBuuilder();&lt;br /&gt;3. public void logTest(String data1, String data2) {&lt;br /&gt;4. testStringBuilder.append(data1);&lt;br /&gt;5. testStringBuilder.append(data2);&lt;br /&gt;6. }&lt;br /&gt;7. }&lt;br /&gt;The programmer must guarantee that a single ClassA object works properly for a multi-threaded system. How must this code be changed to be thread-safe?&lt;/span&gt;&lt;br /&gt;A. Synchronize the logTest method&lt;br /&gt;B. No change is necessary, the current ClassA  code is already thread-safe.&lt;br /&gt;C. replace StringBuilder with just a String object and use the string concatenation (+=) within the logTest method&lt;br /&gt;D. replace StringBuilder with StringBuffer&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: A&lt;br /&gt;&lt;br /&gt;Q: 3 Given:&lt;br /&gt;1 . import java.io.*;&lt;br /&gt;2. public class ClassA implements Serializable {&lt;br /&gt;3. private ClassB tree = new ClassB();&lt;br /&gt;4. public static void main(String [] args) {&lt;br /&gt;5. ClassA classA = new ClassA();&lt;br /&gt;6. try {&lt;br /&gt;7. FileOutputStream fileOutputStream = new FileOutputStream("ClassA.ser");&lt;br /&gt;8. ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream);&lt;br /&gt;9. objectOutputStream.writeObject(classA); &lt;br /&gt;10.objectOutputStream.close();&lt;br /&gt;11. } catch (Exception ex) { ex.printStackTrace(); }&lt;br /&gt;12. } }&lt;br /&gt;13.&lt;br /&gt;14. class ClassB { }&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. An exception is thrown at runtime.&lt;br /&gt;B. Compilation fails.&lt;br /&gt;C. An instance of ClassA is serialized.&lt;br /&gt;D. An instance of ClassA and an instance of ClassB are both serialized.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: A&lt;br /&gt;&lt;br /&gt;Q: 4 Assuming that the serializeClassC() and the deserializeClassC() methods&lt;br /&gt;will correctly use Java serialization and given:&lt;br /&gt;1. import java.io.*;&lt;br /&gt;2. class ClassA {ClassA() { System.out.print("1"); } }&lt;br /&gt;3. class ClassB extends ClassA implements Serializable {&lt;br /&gt;4. ClassB() { System.out.print("2"); } }&lt;br /&gt;5. public class ClassC extends ClassB { int size = 42;&lt;br /&gt;6. public static void main(String [] args) {&lt;br /&gt;7. ClassC b = new ClassC();&lt;br /&gt;8. b.serializeClassC(b); // assume correct serialization&lt;br /&gt;9. b = b.deserializeClassC(b); // assume correct&lt;br /&gt;10. System.out.println(" restored " + b.size + " "); }&lt;br /&gt;11. // more ClassC methods&lt;br /&gt;12. }&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. Compilation fails.&lt;br /&gt;B. 1 restored 42&lt;br /&gt;C. 12 restored 42&lt;br /&gt;D. 121 restored 42&lt;br /&gt;E. 1212 restored 42&lt;br /&gt;F. An exception is thrown at runtime.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: D&lt;br /&gt;&lt;br /&gt;Q: 5 Given this method in a class:&lt;br /&gt;1. public String toString() {&lt;br /&gt;2. StringBuffer testStringBuffer = new StringBuffer();&lt;br /&gt;3. testStringBuffer.append('&lt;');&lt;br /&gt;4. testStringBuffer.append(this.name);&lt;br /&gt;5. testStringBuffer.append('&gt;');&lt;br /&gt;6. return testStringBuffer.toString();&lt;br /&gt;7. }&lt;br /&gt;Which statement is true?&lt;/span&gt;&lt;br /&gt;A. This code will perform well and converting the code to use StringBuilder will not enhance the performance.&lt;br /&gt;B. This code will perform poorly. For better performance, the code should be rewritten:&lt;br /&gt;return "&lt;" + this.name + "&gt;";&lt;br /&gt;C. The programmer can replace StringBuffer with StringBuilder with no other changes.&lt;br /&gt;D. This code is NOT thread-safe.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: C&lt;br /&gt;&lt;br /&gt;Q: 6 Given:&lt;br /&gt;1. double data = 314159.26;&lt;br /&gt;2. NumberFormat nf = NumberFormat.getInstance(Locale.ITALIAN);&lt;br /&gt;3. String b;&lt;br /&gt;4. //insert code here&lt;br /&gt;Which code, inserted at line 4, sets the value of b to 314.159,26?&lt;/span&gt;&lt;br /&gt;A. b = nf.parse( data );&lt;br /&gt;B. b = nf.format( data );&lt;br /&gt;C. b = nf.equals( data );&lt;br /&gt;D. b = nf.parseObject( data );&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: B&lt;br /&gt;&lt;br /&gt;Q: 7 Given:&lt;br /&gt;System.out.format("Pi is approximately %d.", Math.PI);&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. Pi is approximately 3.141593.&lt;br /&gt;B. Pi is approximately 3.&lt;br /&gt;C. Compilation fails.&lt;br /&gt;D. An exception is thrown at runtime.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: D&lt;br /&gt;&lt;br /&gt;Q: 8 Given:&lt;br /&gt;1. public class ClassA implements Comparable&lt;ClassA&gt; {&lt;br /&gt;2. private int data1, data2;&lt;br /&gt;3. public ClassA(int data3, int data4) { data1 = data3; data2 = data4; }&lt;br /&gt;4. public int getTestdata1() { return data1; }&lt;br /&gt;5. public int getTestdata2() { return data2; }&lt;br /&gt;6. public String toString() {&lt;br /&gt;7. return "&lt;" + data1 + "," + data2 + "&gt;";&lt;br /&gt;8. }&lt;br /&gt;9. // insert code here&lt;br /&gt;10. }&lt;br /&gt;Which method will complete this class?&lt;/span&gt;&lt;br /&gt;A. public int compareTo(Object object1){/*more code here*/}&lt;br /&gt;B. public int compareTo(ClassA classA){/*more code here*/}&lt;br /&gt;C. public int compare(ClassA classA1,ClassA classA2){/*more code here*/}&lt;br /&gt;D. public int compare(Object object1,Object object2){/*more code here*/}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: B&lt;br /&gt;&lt;br /&gt;Q: 9 Given:&lt;br /&gt;1. public class ClassA {&lt;br /&gt;2. private String data1;&lt;br /&gt;3. public ClassA(String data1) {&lt;br /&gt;4. this.data1 = data1;&lt;br /&gt;5. }&lt;br /&gt;6. public boolean equals(Object o) {&lt;br /&gt;7. if ( ! o instanceof ClassA ) return false;&lt;br /&gt;8. ClassA p = (ClassA) o;&lt;br /&gt;9. return p.data1.equals(this.data1);&lt;br /&gt;10. }&lt;br /&gt;11. }&lt;br /&gt;Which statement is true?&lt;/span&gt;&lt;br /&gt;A. A HashSet could contain multiple ClassA objects with the same data1.&lt;br /&gt;B. Compilation fails because the hashCode method is not overridden.&lt;br /&gt;C. All ClassA objects will have the same hash code because the hashCode method is not overridden.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: A&lt;br /&gt;&lt;br /&gt;Q: 10 Given:&lt;br /&gt;13. public static void search(List&lt;String&gt; listObject) {&lt;br /&gt;14. listObject.clear();&lt;br /&gt;15. listObject.add("data2");&lt;br /&gt;16. listObject.add("data1");&lt;br /&gt;17. listObject.add("data3");&lt;br /&gt;18. System.out.println(Collections.binarySearch(listObject, "data1"));&lt;br /&gt;19. }&lt;br /&gt;What is the result of calling search with a valid List implementation?&lt;/span&gt;&lt;br /&gt;A. 0&lt;br /&gt;B. 1&lt;br /&gt;C. 2&lt;br /&gt;D. data1&lt;br /&gt;E. data2&lt;br /&gt;F. data3&lt;br /&gt;G. The result cannot be defined.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: G&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Hope you found this useful! Kindly give me your comments regarding the same.Many more Quizzes are to be posted! Kindly make use of them as much as possible!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-6842663086604660622?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/6842663086604660622/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=6842663086604660622&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/6842663086604660622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/6842663086604660622'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/09/java-quiz-17.html' title='Java Quiz -17'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-5513745745719227366</id><published>2009-09-14T09:17:00.005+05:30</published><updated>2009-09-14T09:55:06.913+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Quiz'/><title type='text'>Java Quiz -16</title><content type='html'>Hi friends, &lt;br /&gt;&lt;br /&gt;Today I would like to post few more questions to test your capability. &lt;br /&gt;Dont worry guys, I will give you the answer too! Try to answer it yourself without referring to the answers to test yourself.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 1 Given a method that must ensure that its parameter is not null:&lt;br /&gt;1. public void test(Object data) {&lt;br /&gt;2. // check for null data&lt;br /&gt;...&lt;br /&gt;10. System.out.println(data.getClass());&lt;br /&gt;11. }&lt;br /&gt;What, inserted at line 2, is the appropriate way to handle a null data?&lt;/span&gt;&lt;br /&gt;A. assert data == null;&lt;br /&gt;B. assert data != null, "data is null";&lt;br /&gt;C. if (data == null) {&lt;br /&gt;throw new AssertionException("data is null");&lt;br /&gt;}&lt;br /&gt;D. if (data == null) {&lt;br /&gt;throw new IllegalArgumentException("data is null");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: D&lt;br /&gt;&lt;br /&gt;Q: 2 Given:&lt;br /&gt;1. package javaQuiz;&lt;br /&gt;2. public class ClassA {&lt;br /&gt;3. public InnerClassB classb = new InnerClassB();&lt;br /&gt;4. class InnerClassB {&lt;br /&gt;5. public int data1;&lt;br /&gt;6. public int data2;&lt;br /&gt;7. }&lt;br /&gt;8. }&lt;br /&gt;Which statement is true about the class of an object that can reference the variable data1?&lt;/span&gt;&lt;br /&gt;A. classb can be any class.&lt;br /&gt;B. No class has access to data1.&lt;br /&gt;C. The class must belong to the javaQuiz package.&lt;br /&gt;D. The class must be a subclass of the class ClassA.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: C&lt;br /&gt;&lt;br /&gt;Q: 3 Which four statements are true? (Choose four.)&lt;/span&gt;&lt;br /&gt;A. Has-a relationships can be implemented using instance variables.&lt;br /&gt;B. Is-a relationships can be implemented using the extends keyword.&lt;br /&gt;C. Has-a relationships should never be encapsulated.&lt;br /&gt;D. An array or a collection can be used to implement a one-to-many has-a relationship.&lt;br /&gt;E. The relationship between Movie and Actress is an example of an is-a relationship.&lt;br /&gt;F.  Is-a relationships can be implemented using the implements keyword.&lt;br /&gt;G. Has-a relationships should be implemented using inheritance.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: A, B, D, F&lt;br /&gt;&lt;br /&gt;Q: 4 Given:&lt;br /&gt;0. public class ClassA {&lt;br /&gt;1.&lt;br /&gt;2. private String data1;&lt;br /&gt;3. private Integer data2;&lt;br /&gt;4. public String data3;&lt;br /&gt;5.&lt;br /&gt;6. public void test(String data1,&lt;br /&gt;7. String data3,&lt;br /&gt;8. Integer data2) {&lt;br /&gt;9. this.data1 = data1;&lt;br /&gt;10. this.data3 = data3;&lt;br /&gt;11. this.data2 = data2;&lt;br /&gt;12. }&lt;br /&gt;13. }&lt;br /&gt;Which statement is true?&lt;/span&gt;&lt;br /&gt;A. The code demonstrates polymorphism.&lt;br /&gt;B. The class is fully encapsulated.&lt;br /&gt;C. The data3 variable breaks encapsulation.&lt;br /&gt;D. The data1 and data2 variables break polymorphism.&lt;br /&gt;E. The test method breaks encapsulation.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: C&lt;br /&gt;&lt;br /&gt;Q: 5 Given:&lt;br /&gt;0. abstract class ClassA {&lt;br /&gt;1. abstract void test1();&lt;br /&gt;2. void test2() { }&lt;br /&gt;3. }&lt;br /&gt;4. class ClassB extends ClassA {&lt;br /&gt;5. void test1() { }&lt;br /&gt;6. void test2() { }&lt;br /&gt;7. }&lt;br /&gt;8. class ClassC extends ClassB { void test3() { } }&lt;br /&gt;and:&lt;br /&gt;ClassA classA = new ClassB(); &lt;br /&gt;ClassC classB = new ClassC(); &lt;br /&gt;ClassA classC = new ClassC();&lt;br /&gt;What are four valid examples of polymorphic method calls? (Choose four.)&lt;/span&gt;&lt;br /&gt;A. classA.test2();&lt;br /&gt;B. classC.test2();&lt;br /&gt;C. classC.test3();&lt;br /&gt;D. classC.test1();&lt;br /&gt;E. classB.test3();&lt;br /&gt;F. classA.test1();&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: A, B, D, F&lt;br /&gt;&lt;br /&gt;Q: 6 Given:&lt;br /&gt;1. interface ClassA { public void test(); }&lt;br /&gt;...&lt;br /&gt;10. class ClassB {}&lt;br /&gt;...&lt;br /&gt;20. class ClassC extends ClassB {&lt;br /&gt;21. ClassD classD;&lt;br /&gt;22. }&lt;br /&gt;...&lt;br /&gt;30. class ClassE extends ClassC implements ClassA{&lt;br /&gt;31. public void test() {} &lt;br /&gt;32. }&lt;br /&gt;...&lt;br /&gt;40. class ClassF implements ClassA{&lt;br /&gt;41. public void test() {}&lt;br /&gt;42. }&lt;br /&gt;Which three are true? (Choose three.)&lt;/span&gt;&lt;br /&gt;A. ClassF is-a ClassB&lt;br /&gt;B. ClassF is-a ClassA&lt;br /&gt;C. ClassC is-a ClassB&lt;br /&gt;D. ClassC is-a ClassA&lt;br /&gt;E. ClassF has-a ClassB&lt;br /&gt;F. ClassE has-a ClassD&lt;br /&gt;G. ClassE has-a ClassA&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: B, C, F&lt;br /&gt;&lt;br /&gt;Q: 7 Given:&lt;br /&gt;1. public class ClassA {&lt;br /&gt;2. protected int test(int data) { return 0; }&lt;br /&gt;3. }&lt;br /&gt;4. class ClassB extends ClassA {&lt;br /&gt;5. // insert code here&lt;br /&gt;6. }&lt;br /&gt;Which five methods, inserted independently at line 5, will compile? (Choose five.)&lt;/span&gt;&lt;br /&gt;A. public int test(int data1) { return 0; }&lt;br /&gt;B. private int test(int data1) { return 0; }&lt;br /&gt;C. private int test(long data1) { return 0; }&lt;br /&gt;D. protected long test(int data1) { return 0; }&lt;br /&gt;E. protected int test(long data1) { return 0; }&lt;br /&gt;F. protected long test(long data1) { return 0; }&lt;br /&gt;G. protected long test(int data1, int data2) { return 0; }&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: A, C, E, F, G&lt;br /&gt;&lt;br /&gt;Q: 8 Given:&lt;br /&gt;1. public class ClassA {&lt;br /&gt;2. protected static int test(int data1, int data2) { return data1 * data2;}&lt;br /&gt;3. }&lt;br /&gt;and:&lt;br /&gt;10. public class ClassB extends ClassA{&lt;br /&gt;11. public static int test(int data1, int data2) {&lt;br /&gt;12. int data3 = super.test(data1, data2);&lt;br /&gt;13. return data3;&lt;br /&gt;14. }&lt;br /&gt;15. }&lt;br /&gt;and:&lt;br /&gt;20. ClassB classB = new ClassB ();&lt;br /&gt;21. System.out.println(classB.test(3,4));&lt;br /&gt;22. System.out.println(ClassB.test(2,2));&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. 12&lt;br /&gt;4&lt;br /&gt;B. The code runs with no output.&lt;br /&gt;C. An exception is thrown at runtime.&lt;br /&gt;D. Compilation fails because of an error in line 11.&lt;br /&gt;E. Compilation fails because of an error in line 12.&lt;br /&gt;F. Compilation fails because of an error in line 21.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: E&lt;br /&gt;&lt;br /&gt;Q: 9 Given:&lt;br /&gt;1. class ClassA {&lt;br /&gt;2. java.util.ArrayList data1;&lt;br /&gt;3. public final void testData(String data2) {&lt;br /&gt;4. data1.add(data2);&lt;br /&gt;5. }&lt;br /&gt;6. }&lt;br /&gt;7. public class ClassB extends ClassA {&lt;br /&gt;8. public void testData(String data2) {&lt;br /&gt;9. System.out.println("Cannot add Data1");&lt;br /&gt;10. }&lt;br /&gt;11. public static void main(String[] args) {&lt;br /&gt;12. ClassA classA = new ClassB();&lt;br /&gt;13. classA.testData("Data2");&lt;br /&gt;14. }&lt;br /&gt;15. }&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. The code runs with no output.&lt;br /&gt;B. A NullPointerException is thrown in Line 4.&lt;br /&gt;C. Compilation fails.&lt;br /&gt;D. Cannot add Data1&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: C&lt;br /&gt;&lt;br /&gt;Q: 10 Which three statements are true? (Choose three.)&lt;/span&gt;&lt;br /&gt;A. A final method in class ClassA can be abstract if and only if ClassA is abstract.&lt;br /&gt;B. A protected method in class ClassA can be overridden by any subclass of ClassA.&lt;br /&gt;C. A private static method can be called only within other static methods in class ClassA.&lt;br /&gt;D. A non-static public final method in class ClassA can be overridden in any subclass of ClassA.&lt;br /&gt;E. A public static method in class ClassA can be called by a subclass of ClassA without explicitly referencing the class ClassA.&lt;br /&gt;F. A method with the same signature as a private final method in class ClassA can be implemented in a subclass of ClassA.&lt;br /&gt;G. A protected method in class ClassA can be overridden by a subclass only if the subclass is in the same package as ClassA.&lt;br /&gt;&lt;br /&gt;Answer: B, E, F&lt;br /&gt;&lt;br /&gt;Hope you found this useful! Kindly give me your comments regarding the same.Many more Quizzes are yet to be posted! Kindly make use of them as much as possible!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-5513745745719227366?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/5513745745719227366/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=5513745745719227366&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/5513745745719227366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/5513745745719227366'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/09/java-quiz-16.html' title='Java Quiz -16'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-8303486550823421476</id><published>2009-09-11T09:12:00.003+05:30</published><updated>2009-09-11T09:19:06.400+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Testing and Concepts</title><content type='html'>Hi friends, &lt;br /&gt;&lt;br /&gt;Today I would like to present few points related to Testing and some new Concepts related to Java.I assure you that it will be very informative for the readers.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Round : Testing&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;1.What is Black Box testing and white box testing?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;Black Box Testing:&lt;/span&gt;&lt;br /&gt;   Also known as functional testing. A software testing technique whereby the internal workings of the item being tested are not known by the tester.&lt;br /&gt;&lt;br /&gt;    &lt;span style="font-weight:bold;"&gt;White Box Testing:&lt;/span&gt;&lt;br /&gt;            Also known as glass box, structural, clear box and open box testing. A software testing technique whereby explicit knowledge of the internal workings of the item being tested are used to select the test data. Unlike black box testing, white box testing uses specific knowledge of programming code to examine outputs.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;2.What is the name of the testing supposed to be written by the developers?&lt;/span&gt;&lt;br /&gt;  White Box Testing.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;3.Give the name of 2 performance of testing tools?&lt;/span&gt;&lt;br /&gt;  Apache Jmeter,curl loader.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;4.Give the name of 2 automated testing tools?&lt;/span&gt;&lt;br /&gt;  QTP and Winrunner,Rational Robot.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;5.Difference between stress testing and load testing?&lt;/span&gt;&lt;br /&gt;  Stress Testing : To test how the application is responding while we enter maximum length of strings into the application.&lt;br /&gt;  Load Testing : To test the application respond(response time) by increasing the number of users.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Round:Concepts&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;1.Namespace&lt;/span&gt;&lt;br /&gt; As a rule, names in a namespace cannot have more than one meaning, that is, two or more things cannot share the same name.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;2.Lazy loading&lt;/span&gt;&lt;br /&gt;        Lazy loading, also known as dynamic function loading , is a mode that allows a developer to specify what components of a program should not be loaded into storage by default when a program is started. Ordinarily, the system loader automatically loads the initial program and all of its dependent components at the same time. In lazy loading, dependents are only loaded as they are specifically requested. Lazy loading can be used to improve the performance of a program if most of the dependent components are never actually used.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;3.Two Phase Commit&lt;/span&gt;&lt;br /&gt; The two-phase commit strategy is designed to ensure that either all the databases are updated or none of them, so that the databases remain synchronized.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;4.Server affinity&lt;/span&gt;&lt;br /&gt; Server affinity refers to the characteristics of each load distribution facility that take these constraints into account. The load distribution facility recognizes that multiple servers can be acceptable targets for a request. However, it also recognizes that each request can be directed to a particular server where it is handled better or faster. &lt;br /&gt;&lt;br /&gt;Server affinity can be weak or strong. &lt;br /&gt;&lt;br /&gt; In weak server affinity, the system attempts to enforce the desired affinity for the majority of requests, but does not always guarantee that this affinity will be respected. &lt;br /&gt; In strong server affinity, the system guarantees that affinity is always respected and generates an error when it cannot direct a request to the appropriate server. &lt;br /&gt;   &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;5.Soft Deletion.&lt;/span&gt;&lt;br /&gt; There also has to be a special handling of the delete operation. Not every client has enough space for every database item. Sometimes we want to remove an item from just one client, but not from the others.&lt;br /&gt; Introduce a flag to an existing table which indicates that a row has been deleted (this is called a soft/logical delete) instead of actually deleting the row (a hard delete).&lt;br /&gt;&lt;br /&gt;Hope this topic was useful to you, Please Post your comments!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-8303486550823421476?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/8303486550823421476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=8303486550823421476&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/8303486550823421476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/8303486550823421476'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/09/testing-and-concepts.html' title='Testing and Concepts'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-8983091649758653309</id><published>2009-09-10T09:33:00.006+05:30</published><updated>2009-09-10T09:40:54.058+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>About Product,Companies and Databases</title><content type='html'>Hi friends, &lt;br /&gt;&lt;br /&gt;Today I would like to present few points related to Product,Companies and Databases which would be helpful for the readers.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Round:About Product and Companies&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1.How is the company that tells the “System applications and products for data processing”better known as?&lt;br /&gt;  &lt;span style="font-weight:bold;"&gt;SAP&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;2.Five colleagues working for patni computers ,resigned their job and started a company with an investment of 10000.Today this company is a house hold name. Which company we are talking about?&lt;br /&gt;  &lt;span style="font-weight:bold;"&gt;Infosys&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;3.Mark Shuttleworth is a South African entrepreneur who was the second self funded space tourist. Which software product is he responsible for?&lt;br /&gt;&lt;br /&gt;  &lt;span style="font-weight:bold;"&gt;Ubuntu&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;4.Which product is advertised “Hello coming in june”.This product is now a rage and set the benchmark in its category.&lt;br /&gt;  &lt;span style="font-weight:bold;"&gt;Ipod&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5.Microsoft is accused by Apple to have copies of Apple's windows or gui concept. From which company/organization did Apple copy it from?&lt;br /&gt;  &lt;span style="font-weight:bold;"&gt;Xerox&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Round:Databases&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;1.What is surrogate key?&lt;/span&gt;&lt;br /&gt; A surrogate key in a  is a unique identifier for either an entity in the modeled world or an object in the database. The surrogate key is not derived from application data.&lt;br /&gt;A surrogate should have the following&lt;br /&gt;the value is unique system-wide, hence never reused; &lt;br /&gt;the value is system generated; &lt;br /&gt;the value is not manipulable by the user or application; &lt;br /&gt;the value contains no semantic meaning; &lt;br /&gt;the value is not visible to the user or application; &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;2.What is the difference between union and unionall?&lt;/span&gt;&lt;br /&gt;  Union will filter duplicate values but union all will not filter duplicate values.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;3.Every non-key attribute if fully functionally dependent on primary key.Which normal form it is?&lt;/span&gt;&lt;br /&gt;  2nd Normal form.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;4.What is the difference between primary key and unique key?&lt;/span&gt;&lt;br /&gt;The column holding the primary key constraint cannot accept  null values.whereas column holding the unique constraint can accept null values .&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;5.What is the difference between DELETE TABLE and TRUNCATE TABLE?&lt;/span&gt;&lt;br /&gt; TRUNCATE is a DDL command and cannot be rolled back. All of the memory space is released back to the server. &lt;br /&gt;DELETE is a DML command and can be rolled back.&lt;br /&gt;&lt;br /&gt;Hope this topic was useful to you, Please Post your comments!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-8983091649758653309?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/8983091649758653309/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=8983091649758653309&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/8983091649758653309'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/8983091649758653309'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/09/about-productcompanies-and-databases.html' title='About Product,Companies and Databases'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-6605141507691205212</id><published>2009-09-09T12:15:00.005+05:30</published><updated>2009-09-09T12:19:35.125+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>People and Java code debugging</title><content type='html'>Hi friends, &lt;br /&gt;&lt;br /&gt;Today I would like to present few concepts in People related to Open Source and Java code debugging which would be helpful for the readers. &lt;br /&gt;&lt;br /&gt;Without wasting further time, Here We Go!&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Round :People&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;1.Who created Java?&lt;/span&gt;&lt;br /&gt;	James Gosling(born May 19, 1955 near Calgary, Alberta, Canada).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;2.Who invented C++?&lt;/span&gt;&lt;br /&gt;	Bjarne Stroutstrup.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;3.Who is the well known founder of Oracle?&lt;/span&gt;&lt;br /&gt;	Lawrence Joseph Larry Ellison.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;4.Who is the well known founder of Apple?&lt;/span&gt;&lt;br /&gt;	Steven Paul Jobs.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;5.He is from Moolaipozhi village near Tirunelvelli.Went on to start an IT company which is among top ten Indian IT services firms.&lt;br /&gt;Who is this man and which company he create?&lt;/span&gt;&lt;br /&gt;	Shiv Nadar - HCL&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Round : Java code debugging&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1.public class Test {&lt;br /&gt;	public static void main(String[] args) throws Exception{&lt;br /&gt;		BigInteger fiveThousand = new BigInteger("5000");&lt;br /&gt;		BigInteger fiftyThousand = new BigInteger("50000");&lt;br /&gt;		BigInteger fiveHundredThousand = new BigInteger("500000");&lt;br /&gt;		BigInteger Total =BigInteger.ZERO;&lt;br /&gt;		System.out.println(Total);&lt;br /&gt;		Total.add(fiveThousand);&lt;br /&gt;		Total.add(fiftyThousand);&lt;br /&gt;		Total.add(fiveHundredThousand);&lt;br /&gt;		System.out.println(Total);&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;	&lt;span style="font-weight:bold;"&gt;Output:0&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2.package com.planetsoft;&lt;br /&gt;public class Me{&lt;br /&gt;public static void main(String[] args){&lt;br /&gt;System.out.println(Me.class.getName().replaceAll(“.”,”\”)+”.class”);&lt;br /&gt;}&lt;br /&gt;	&lt;span style="font-weight:bold;"&gt;output://///////////////.class&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3..public boolean isOdd(int i){&lt;br /&gt;	return i%2==1;&lt;br /&gt;}&lt;br /&gt;	&lt;span style="font-weight:bold;"&gt;Output: if we give odd numbers with negative it will return false . For eg: Lets take the value of i=-3 , after computing i%2 the value will be -1 and it will check -1==1 ,hence both not equals it will return false.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4..Write a one line method that takes a list and returns a list , eliminating duplicates and preserving the order of the original list?&lt;br /&gt;		&lt;span style="font-weight:bold;"&gt;Let duplicatedList be a Array list variable with duplicate values.whereas&lt;br /&gt;		LinkedHashSet&lt;Integer&gt; list = new inkedHashSet&lt;Integer&gt;(duplicatedList);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5. Write a one line method that takes comma a demilited strings and return a string[],each comma may be followed by zero or more spaces which must be ignored by the method.&lt;br /&gt;                             &lt;span style="font-weight:bold;"&gt;It can be achieved using the regular expression.Here is the example using String,Similar way we can do that for string array.&lt;br /&gt;		String s = ", There , , a , is a ,        , ,  null , object ,";&lt;br /&gt;		s=s.replaceAll("%*, *","" );&lt;br /&gt;		System.out.println(s); &lt;/span&gt;             &lt;br /&gt;&lt;br /&gt;                                                                      &lt;br /&gt;1.public class TestList {&lt;br /&gt;	public static void main(String[] args) throws Exception{&lt;br /&gt;		final long micros_perDay = 24*60*60*1000*1000;&lt;br /&gt;		final long macros_perDay = 24*60*60*1000;&lt;br /&gt;		System.out.println(micros_perDay/macros_perDay);&lt;br /&gt;	}&lt;br /&gt;}	&lt;span style="font-weight:bold;"&gt;output:5&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2.public class AnimalFarm {&lt;br /&gt;		public static void main(String[] args) throws IOException{&lt;br /&gt;		final String pig = "length: 10";&lt;br /&gt;		final String pig1 = "length :"+pig.length();&lt;br /&gt;		System.out.println("animals are equal"+pig==pig1);&lt;br /&gt;			&lt;br /&gt;	} &lt;br /&gt;  }  &lt;br /&gt;	&lt;span style="font-weight:bold;"&gt;output:false&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3.public class SetMagic {&lt;br /&gt;	public static void main(String[] args) throws IOException{&lt;br /&gt;		int[] vals = {10,012,14,016};&lt;br /&gt;		Set&lt;Integer&gt; magic = new HashSet&lt;Integer&gt;();&lt;br /&gt;		for(int i=0;i&lt;vals.length;i++){&lt;br /&gt;			magic.add(vals[i]);&lt;br /&gt;		}System.out.println(magic.size());&lt;br /&gt;	} &lt;br /&gt;    }  		&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;output:2&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;4.public class Increment {&lt;br /&gt;	public static void main(String[] args){&lt;br /&gt;	int j=0;&lt;br /&gt;	for(int i=0;i&lt;100;i++){&lt;br /&gt;	j=j++;&lt;br /&gt;	}&lt;br /&gt;	System.out.println(j);&lt;br /&gt;	} &lt;br /&gt;}  &lt;br /&gt;	&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;output:0&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;5.Provide a definition for i so that the loop turns into a infinite loop.&lt;br /&gt;while(i!=i){&lt;br /&gt;system.out.println(“please stop”);&lt;br /&gt;}&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;output: we can declare i&lt;br /&gt;          double i=Double.Nan;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Hope this topic was useful to you, Please Post your comments!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-6605141507691205212?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/6605141507691205212/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=6605141507691205212&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/6605141507691205212'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/6605141507691205212'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/09/people-and-java-code-debugging.html' title='People and Java code debugging'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-2996480464319088996</id><published>2009-09-07T08:55:00.009+05:30</published><updated>2009-09-07T09:13:13.865+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Quiz'/><title type='text'>Java Quiz -15</title><content type='html'>Hi friends,&lt;br /&gt;&lt;br /&gt;Today I would like to present few concepts in Open Source and Java API's in today's Quiz which would be helpful for the readers.&lt;br /&gt;&lt;br /&gt;Without wasting further time, Here We Go!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Round : Open Source Round&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;1.Who started the open source movement?&lt;/span&gt;&lt;br /&gt;	Richard Stallman&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;2.What does”free as freedom, free as in beer” means in the context of Open Source?&lt;/span&gt;&lt;br /&gt;	“free as freedom” phrase describes that the users can modify the functionality of the open source.&lt;br /&gt;	“free as in beer” phrase describes that the users can get the liscence free of cost.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;3.Give the name three Open Source softwares?&lt;/span&gt;&lt;br /&gt;	UNIX,LINUX,Perl&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;4.Give the name of three open source databases?&lt;/span&gt;&lt;br /&gt;	Hsql,MySql,PostgreSQL&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;5.What is the name of open source webserver which is most widely used webserver in the world?&lt;/span&gt;&lt;br /&gt;	Apache,Jakarta Tomcat,Tornado&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Round : Java API's Round&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;1.   How do you achieve custom serialization?&lt;/span&gt;&lt;br /&gt;	We can achieve this by overriding the writeObject() and readObject() methods in ObjectOutputStream and ObjectInputStream.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;2.  I have an int column in the database that is null.&lt;br /&gt;I do a rs.getInt() on that column and get a 0.&lt;br /&gt;How do u find out whether the column has a value of 0 or its null?&lt;/span&gt;&lt;br /&gt;Using the rs.wasNull() will return a boolean.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;3.I have a list of String objects.&lt;br /&gt;I want to create string array from the list not an object array.&lt;br /&gt;How do u achieve this?&lt;/span&gt;&lt;br /&gt;ArrayList&lt;string&gt; a1 = new ArrayList&lt;string&gt;();&lt;br /&gt;a1.add("1");&lt;br /&gt;a1.add("2");&lt;br /&gt;a1.add("3");&lt;br /&gt;String st1[] = new String[a.size()];&lt;br /&gt;for(int i=0; i&lt;a1a1.size();i++){&lt;br /&gt;      st1[i]=a1.get(i);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Hope you found this useful! Kindly give me your comments regarding the same.Many more Quizzes are yet to be posted! Kindly make use of them as much as possible! &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-2996480464319088996?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/2996480464319088996/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=2996480464319088996&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/2996480464319088996'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/2996480464319088996'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/09/java-quiz-15.html' title='Java Quiz -15'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-8362367782127127760</id><published>2009-09-04T16:13:00.003+05:30</published><updated>2009-09-04T16:17:02.370+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Quiz'/><title type='text'>Round :Basic Computer Science</title><content type='html'>&lt;p&gt;Hi friends,&lt;br /&gt;&lt;br /&gt;Its been sometime since we shared some information regarding the concepts(For those who missed out, We had been doing Few Java Quizzes! Check It out Here &lt;br /&gt;http://helptotheneeded.blogspot.com/search/label/Java%20Quiz)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Today I would like to present few concepts in basic Computer Science which would be helpful for the readers&lt;br /&gt;&lt;br /&gt;Without wasting further time, Here We Go!&lt;br /&gt;&lt;/p&gt;&lt;strong&gt;1.Give names of two sorting algorithms&lt;/strong&gt;&lt;br /&gt; 	Bubble sort,Insertion sort,Shell sort,Merge sort,Heap sort,Quick sort,Radix sort,Bucket sort,Distribution sort,Shuffle sort.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2.What is the name of the style of programming where the function calls itself?&lt;/strong&gt;&lt;br /&gt; 	Recursion&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3.Name any two searching algorithms&lt;/strong&gt;&lt;br /&gt; 	Breadth-First search,Depth limited search,Kruskal's algorithms,Prim's algorithms,Grover's algorithms,Dijikistra's algorithms.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4.What is Pointer?&lt;/strong&gt;&lt;br /&gt; 	A pointer is a variable which contains the address in memory of another variable.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5.Give two names of typical data structure:&lt;/strong&gt;&lt;br /&gt; 	Stack,Queue,Linked list,Doubly Linked List.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;6.What is priority queue?&lt;/strong&gt;&lt;br /&gt; 	An element's priority is the time that element was  inserted.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;7.What is a binary tree?&lt;/strong&gt;&lt;br /&gt; 	A binary tree is a  in which each node has at most two .&lt;br /&gt; 	-The left  of a node contains only nodes with keys less than the node's key. -The right subtree of a node contains only nodes with keys greater than node's key.Both the left and right subtrees must also be binary search trees. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;8.What is a self Referential structure?&lt;/strong&gt;&lt;br /&gt; 	It is a important characteristic of the data structures used to implement lists , is that they contain, as a member, a reference variable of the same type as the class itself. For this reason, these data structures are frequently called self-referential or recursive data structures .&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;9.What is/are difference(s) between tree and graph?&lt;/strong&gt;&lt;br /&gt; 	-Tree has no loop but graph has loops. &lt;br /&gt; 	-Tree always has direction but graph do not have direction.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;10.What is the complexity of the Big O notation in the following pseudo code:&lt;/strong&gt;&lt;br /&gt; n=100;&lt;br /&gt; for(i=O;i&lt;n;i++){&lt;br /&gt; 	do something;&lt;br /&gt; }&lt;br /&gt; 	The complexity of the Big O notation is o(n)..&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-8362367782127127760?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/8362367782127127760/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=8362367782127127760&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/8362367782127127760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/8362367782127127760'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/09/round-basic-computer-science.html' title='Round :Basic Computer Science'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-6901226036822701543</id><published>2009-09-03T18:05:00.002+05:30</published><updated>2009-09-03T18:12:44.352+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Java Acronyms</title><content type='html'>&lt;p&gt;Hi friends,&lt;br /&gt;&lt;br /&gt;Its been sometime since we shared some information regarding the concepts(For those who missed out, We had been doing Few Java Quizzes! Check It out Here &lt;br /&gt;&lt;strong&gt;http://helptotheneeded.blogspot.com/search/label/Java%20Quiz)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Today I would like to present few acronyms which would be helpful for the readers&lt;br /&gt;&lt;br /&gt;Without wasting further time, Here We Go!&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Round :Acronyms&lt;/strong&gt; &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;1.&lt;strong&gt;BPM&lt;/strong&gt; – Business Process Management&lt;br /&gt;-a field of management focused on aligning organizations with the wants and needs of clients.&lt;br /&gt;&lt;br /&gt;2.&lt;strong&gt;JAXB&lt;/strong&gt;- Java Architecture for XML Binding&lt;br /&gt;-XML and Java technology are recognized as ideal building blocks for developing Web services and applications that access Web services. A new Java API called Java Architecture for XML Binding (JAXB) can make it easier to access XML documents from applications written in the Java programming language.&lt;br /&gt;&lt;br /&gt;3.&lt;strong&gt;SOA&lt;/strong&gt;-Service Oriented Architecture&lt;br /&gt;-a computer systems architectural style for creating and  using business processes,    packaged as services&lt;br /&gt;&lt;br /&gt;4.&lt;strong&gt;ORM&lt;/strong&gt;-Object Relational Mapping&lt;br /&gt;     -a software-programming issue in linking object-oriented  code with relational        databases .&lt;br /&gt;&lt;br /&gt;5.&lt;strong&gt;XP&lt;/strong&gt; – Extreme Programming&lt;br /&gt;    -is a software engineering methodology which is intended to     &lt;br /&gt;    improve software quality and responsiveness to changing &lt;br /&gt;    customer requirements.&lt;br /&gt;&lt;br /&gt;6.&lt;strong&gt;3NF&lt;/strong&gt;-Third Normal Form&lt;br /&gt;  -In order to be in a third normal form,a relation must fulfill     &lt;br /&gt;  the requirements to be in second normal form .Additionally all     &lt;br /&gt;  attributes that are not dependent upon the primary key must be       &lt;br /&gt;  eliminated.&lt;br /&gt;&lt;br /&gt;7.&lt;strong&gt;MD5&lt;/strong&gt; – Message Digest Algorithm 5.&lt;br /&gt;-In cryptography, MD5 (Message-Digest algorithm 5) is a widely used cryptographic hash function with a 128-bit hash value.&lt;br /&gt;&lt;br /&gt;8.&lt;strong&gt;XSLT&lt;/strong&gt; – Extensible Stylesheet Language Transformation.&lt;br /&gt;   - a style sheet language for XML documents.&lt;br /&gt;&lt;br /&gt;9.&lt;strong&gt;SAAS&lt;/strong&gt; – Software As a Service.&lt;br /&gt;-The sharing of end-user licenses and on-demand use may also reduce investment in server hardware or the shift of server use to SaaS suppliers of applications file services.&lt;br /&gt;&lt;br /&gt;10.&lt;strong&gt;AOP&lt;/strong&gt; – Aspect Oriented Programming&lt;br /&gt;&lt;p&gt;is a programming paradigm that increases modularity by allowing the separation of cross-cutting concerns, forming a basis for aspect-oriented software development.&lt;/p&gt;&lt;p&gt;Hope this topic was useful to you, Please Post your comments!&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-6901226036822701543?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/6901226036822701543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=6901226036822701543&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/6901226036822701543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/6901226036822701543'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/09/java-acronyms.html' title='Java Acronyms'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-2809951237371667745</id><published>2009-09-02T09:00:00.003+05:30</published><updated>2009-09-02T09:04:22.340+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Quiz'/><title type='text'>Java Quiz -14</title><content type='html'>&lt;p&gt;Hi friends, &lt;br /&gt;&lt;br /&gt;Today I would like to post few more questions to test your capability. &lt;br /&gt;Dont worry guys, I will give you the answer too! Try to answer it yourself without referring to the answers to test yourself.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: 1 Given:&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;1. public class ClassA {&lt;br /&gt;2. private int data1;&lt;br /&gt;3. public void test1() {&lt;br /&gt;4. int tips = data1;&lt;br /&gt;5. data1 = tips + 1;&lt;br /&gt;6. }&lt;br /&gt;7. public void test2() {&lt;br /&gt;8. for(int data2 = 0; data2 &lt; 5; data2++) {&lt;br /&gt;9. new Thread() {&lt;br /&gt;10. public void test2() {&lt;br /&gt;11. test1();&lt;br /&gt;12. System.out.print(data1 + ", ");&lt;br /&gt;13. } }.start();&lt;br /&gt;14. } }&lt;br /&gt;Which two changes, taken together, would guarantee the output: 1, 2, 3, 4, 5, ?&lt;/strong&gt;&lt;br /&gt;A. move the line 12 print statement into the test1() method&lt;br /&gt;B. change line 7 to public synchronized void test2() {&lt;br /&gt;C. change the variable declaration on line 2 to private volatile int data1;&lt;br /&gt;D. wrap the code inside the test1() method with a synchronized( this ) block&lt;br /&gt;E. wrap the for loop code inside the test2() method with a synchronized block synchronized(this) { // for loop&lt;br /&gt;code here }&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Answer: A, D&lt;br /&gt;&lt;br /&gt;Q: 2 Given:&lt;br /&gt;classA1 and classA2 are public references available to many other threads. classA1 refers to a Thread and classA2 is an&lt;br /&gt;Object. The thread classA1 is currently executing classA2.wait().&lt;br /&gt;From another thread, what provides the most reliable way to ensure that classA1 will stop executing wait()?&lt;/strong&gt;&lt;br /&gt;A. classA1.notifyAll();&lt;br /&gt;B. classA1.notify();&lt;br /&gt;C. classA2.notify();&lt;br /&gt;D. Object.notify();&lt;br /&gt;E. Thread.notify();&lt;br /&gt;F. classA2.notifyAll();&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Answer: F&lt;br /&gt;&lt;br /&gt;Q: 3 Given:&lt;br /&gt;1. static void test() throws RuntimeException {&lt;br /&gt;2. try {&lt;br /&gt;3. System.out.print("test ");&lt;br /&gt;4. throw new RuntimeException();&lt;br /&gt;5. }&lt;br /&gt;6. catch (Exception ex) { System.out.print("exception1 "); }&lt;br /&gt;7. }&lt;br /&gt;8. public static void main(String[] args) {&lt;br /&gt;9. try { test(); }&lt;br /&gt;10. catch (RuntimeException ex) { System.out.print("exception2 "); }&lt;br /&gt;11. System.out.print("data ");&lt;br /&gt;12. }&lt;br /&gt;What is the result?&lt;/strong&gt;&lt;br /&gt;A. test data&lt;br /&gt;B. A Throwable is thrown by main at exception2.&lt;br /&gt;C. test exception2 data&lt;br /&gt;D. test exception data&lt;br /&gt;E. Compilation fails.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Answer: D&lt;br /&gt;&lt;br /&gt;Q: 4 Given:&lt;br /&gt;1. Float pi = new Float(10.14f);&lt;br /&gt;2. if (pi &gt; 10) {&lt;br /&gt;3. System.out.print("pi is bigger than 10. ");&lt;br /&gt;4. }&lt;br /&gt;5. else {&lt;br /&gt;6. System.out.print("pi is not bigger than 10. ");&lt;br /&gt;7. }&lt;br /&gt;8. finally {&lt;br /&gt;9. System.out.println("Answer it yourself.");&lt;br /&gt;10. }&lt;br /&gt;What is the result?&lt;/strong&gt;&lt;br /&gt;A. An exception occurs at runtime.&lt;br /&gt;B. pi is bigger than 10.&lt;br /&gt;C. Compilation fails.&lt;br /&gt;D. pi is bigger than 10. Answer it yourself.&lt;br /&gt;E. pi is not bigger than 10. Answer it yourself.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Answer: C&lt;br /&gt;&lt;br /&gt;Q: 5 Given:&lt;br /&gt;1. public static Iterator test(List listdata) {&lt;br /&gt;2. Collections.test(listdata);&lt;br /&gt;3. return listdata.iterator();&lt;br /&gt;4. }&lt;br /&gt;5. public static void main(String[] args) {&lt;br /&gt;6. List listdata = new ArrayList();&lt;br /&gt;7. listdata.add("1"); listdata.add("2"); listdata.add("3");&lt;br /&gt;8. for (Object objdata: test(listdata))&lt;br /&gt;9. System.out.print(objdata + ", ");&lt;br /&gt;10. }&lt;br /&gt;What is the result?&lt;/strong&gt;&lt;br /&gt;A. Compilation fails.&lt;br /&gt;B. 1, 2, 3,&lt;br /&gt;C. 3, 2, 1,&lt;br /&gt;D. The code runs with no output.&lt;br /&gt;E. An exception is thrown at runtime.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Answer: A&lt;br /&gt;&lt;br /&gt;Q: 6 Given:&lt;br /&gt;1. class ClassA {&lt;br /&gt;2. public void process() { System.out.print("ClassA,"); }&lt;br /&gt;3. class ClassB extends ClassA {&lt;br /&gt;4. public void process() throws IOException {&lt;br /&gt;5. super.process();&lt;br /&gt;6. System.out.print("ClassB,");&lt;br /&gt;7. throw new IOException();&lt;br /&gt;8. }&lt;br /&gt;9. public static void main(String[] args) {&lt;br /&gt;10. try { new ClassB().process(); }&lt;br /&gt;11. catch (IOException e) { System.out.println("Exception"); }&lt;br /&gt;What is the result?&lt;/strong&gt;&lt;br /&gt;A. Exception&lt;br /&gt;B. ClassA,ClassB,Exception&lt;br /&gt;C. Compilation fails because of an error in line 10.&lt;br /&gt;D. Compilation fails because of an error in line 4.&lt;br /&gt;E. ClassA NullPointerException is thrown at runtime.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Answer: D&lt;br /&gt;&lt;br /&gt;Q: 7 Given:&lt;br /&gt;1. try {&lt;br /&gt;2. // some code here&lt;br /&gt;3. } catch (NullPointerException e1) {&lt;br /&gt;4. System.out.print("exception1");&lt;br /&gt;5. } catch (RuntimeException e2) {&lt;br /&gt;6. System.out.print("exception2");&lt;br /&gt;7. } finally {&lt;br /&gt;8. System.out.print("exception3");&lt;br /&gt;9. }&lt;br /&gt;What is the result if exception1 NullPointerException occurs on line 34?&lt;/strong&gt;&lt;br /&gt;A. exception3&lt;br /&gt;B. exception1&lt;br /&gt;C. exception1exception2&lt;br /&gt;D. exception1exception3&lt;br /&gt;E. exception2exception3&lt;br /&gt;F. exception1exception2exception3&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Answer: D&lt;br /&gt;&lt;br /&gt;Q: 8 Given:&lt;br /&gt;1. public static Collection get() {&lt;br /&gt;2. Collection sorted = new LinkedList();&lt;br /&gt;3. sorted.add("data2"); sorted.add("data3"); sorted.add("data1");&lt;br /&gt;4. return sorted;&lt;br /&gt;5. }&lt;br /&gt;6. public static void main(String[] args) {&lt;br /&gt;7. for (Object obj: get()) {&lt;br /&gt;8. System.out.print(obj + ", ");&lt;br /&gt;9. }&lt;br /&gt;10. }&lt;br /&gt;What is the result?&lt;/strong&gt;&lt;br /&gt;A. data1, data2, data3,&lt;br /&gt;B. data2, data3, data1,&lt;br /&gt;C. An exception is thrown at runtime.&lt;br /&gt;D. Compilation fails.&lt;br /&gt;E. The code runs with no output.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Answer: B&lt;br /&gt;&lt;br /&gt;Q: 9 Given:&lt;br /&gt;1. int z = 5;&lt;br /&gt;2.&lt;br /&gt;3. public void stuff1(int x) {&lt;br /&gt;4. assert (x &gt; 0);&lt;br /&gt;5. switch(x) {&lt;br /&gt;6. case 2: x = 3;&lt;br /&gt;7. default: assert false; } }&lt;br /&gt;8.&lt;br /&gt;9. private void stuff2(int y) { assert (y &lt; 0); }&lt;br /&gt;10.&lt;br /&gt;11. private void stuff3() { assert (stuff4()); }&lt;br /&gt;12.&lt;br /&gt;13. private boolean stuff4() { z = 6; return false; }&lt;br /&gt;Which statement is true?&lt;/strong&gt;&lt;br /&gt;A. Only the assert statement on line 9 is used appropriately.&lt;br /&gt;B. All of the assert statements are used appropriately.&lt;br /&gt;C. The assert statements on lines 7 and 9 are used appropriately.&lt;br /&gt;D. The assert statements on lines 4 and 7 are used appropriately.&lt;br /&gt;E. The assert statements on lines 7 and 11 are used appropriately.&lt;br /&gt;F. The assert statements on lines 7, 9, and 11 are used appropriately.&lt;br /&gt;G. The assert statements on lines 4, 7, and 9 are used appropriately.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Answer: C&lt;br /&gt;&lt;br /&gt;Q: 10 Given:&lt;br /&gt;1. public class Test {&lt;br /&gt;2. public static void main(String [] args) {&lt;br /&gt;3. int data1 = 5;&lt;br /&gt;4. boolean data2 = true;&lt;br /&gt;5. boolean data3 = false;&lt;br /&gt;6.&lt;br /&gt;7. if ((data1 == 4) &amp;amp;&amp;amp; !data3 )&lt;br /&gt;8. System.out.print("test1 ");&lt;br /&gt;9. System.out.print("test2 ");&lt;br /&gt;10. if ((data3 = true) &amp;amp;&amp;amp; data2 )&lt;br /&gt;11. System.out.print("test3 ");&lt;br /&gt;12. }&lt;br /&gt;13. }&lt;br /&gt;What is the result?&lt;/strong&gt;&lt;br /&gt;A. test2&lt;br /&gt;B. test3&lt;br /&gt;C. test1 test2&lt;br /&gt;D. test2 test3&lt;br /&gt;E. test1 test2 test3&lt;br /&gt;F. An exception is thrown at runtime.&lt;br /&gt;G. Compilation fails.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Answer: D&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Hope you found this useful! Kindly give me your comments regarding the same.Many more Quizzes are yet to be posted! Kindly make use of them as much as possible! &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-2809951237371667745?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/2809951237371667745/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=2809951237371667745&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/2809951237371667745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/2809951237371667745'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/09/java-quiz-14.html' title='Java Quiz -14'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-6689202281665773296</id><published>2009-09-01T10:46:00.004+05:30</published><updated>2009-09-01T11:24:33.239+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Quiz'/><title type='text'>Java Quiz -13</title><content type='html'>&lt;p&gt;Hi friends, &lt;br /&gt;&lt;br /&gt;Today I would like to post few more questions to test your capability. &lt;br /&gt;Dont worry guys, I will give you the answer too! Try to answer it yourself without referring to the answers to test yourself.&lt;strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: 1 Given:&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;1. void waitTest() {&lt;br /&gt;2. Object obj = new Object();&lt;br /&gt;3. synchronized (Thread.currentThread()) {&lt;br /&gt;4. obj.wait();&lt;br /&gt;5. obj.notify();&lt;br /&gt;6. }&lt;br /&gt;7. }&lt;br /&gt;Which statement is true?&lt;/strong&gt;&lt;br /&gt;A. This code may throw an InterruptedException.&lt;br /&gt;B. This code may throw an IllegalStateException.&lt;br /&gt;C. This code may throw a TimeoutException after ten minutes.&lt;br /&gt;D. This code will not compile unless "obj.wait()" is replaced with "((Thread) obj).wait()".&lt;br /&gt;E. Reversing the order of obj.wait() and obj.notify() may cause this method to complete normally.&lt;br /&gt;&lt;p&gt;F. A call to notify() or notifyAll() from another thread may cause this method to complete normally.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Answer: B&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: 2 Given:&lt;br /&gt;1. public class TestClassA implements Runnable {&lt;br /&gt;2. public static void main (String[] args) throws Exception {&lt;br /&gt;3. Thread t = new Thread(new TestClassA());&lt;br /&gt;4. t.start();&lt;br /&gt;5. System.out.print("Started");&lt;br /&gt;6. t.join();&lt;br /&gt;7. System.out.print("Complete");&lt;br /&gt;8. }&lt;br /&gt;9. public void run() {&lt;br /&gt;10. for (int test = 0; test &lt; 4; test++) {&lt;br /&gt;11. System.out.print(test);&lt;br /&gt;12. }&lt;br /&gt;13. }&lt;br /&gt;14. }&lt;br /&gt;What can be a result?&lt;/strong&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;A. An exception is thrown at runtime.&lt;br /&gt;B. The code executes and prints "Started0123Complete".&lt;br /&gt;C. The code executes and prints "StartedComplete".&lt;br /&gt;D. Compilation fails.&lt;br /&gt;E. The code executes and prints "StartedComplete0123".&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;br /&gt;Answer:B&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: 3 Which ClassB code fragments will execute the method doData() in a separate&lt;br /&gt;&lt;/strong&gt;&lt;strong&gt;thread? (Choose two.)&lt;br /&gt;&lt;/strong&gt;A. new Thread() {&lt;br /&gt;public void run() { doData(); }&lt;br /&gt;};&lt;br /&gt;B. new Thread() {&lt;br /&gt;public void start() { doData(); }&lt;br /&gt;};&lt;br /&gt;C. new Thread() {&lt;br /&gt;public void start() { doData(); }&lt;br /&gt;}.run();&lt;br /&gt;D. new Thread() {&lt;br /&gt;public void run() { doData(); }&lt;br /&gt;}.start();&lt;br /&gt;E. new Thread(new Runnable() {&lt;br /&gt;public void run() { doData(); }&lt;br /&gt;}).run();&lt;br /&gt;F. new Thread(new Runnable() {&lt;br /&gt;public void run() { doData(); }&lt;br /&gt;}).start();&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;br /&gt;Answer: D, F&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: 4 Given:&lt;br /&gt;&lt;/strong&gt;&lt;strong&gt;1. interface A { public int getData(); }&lt;br /&gt;2. class ClassB implements A {&lt;br /&gt;3. public int getData() { return 1; }&lt;br /&gt;4. }&lt;br /&gt;5. class ClassC extends B {&lt;br /&gt;6. // insert code here&lt;br /&gt;7. }&lt;br /&gt;Which ClassC code fragments, inserted individually at line 4, make use of polymorphism? (Choose three.)&lt;br /&gt;&lt;/strong&gt;A. public void add( ClassC c) { c.getData(); }&lt;br /&gt;B. public void add( ClassB b) { b.getData(); }&lt;br /&gt;C. public void add(A a) { a.getData(); }&lt;br /&gt;D. public void add(A a, ClassB b) { a.getData(); }&lt;br /&gt;E. public void add( ClassC c1, ClassC c2) { c1.getData(); }&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;br /&gt;Answer: B, C, D&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: 5 Given:&lt;br /&gt;&lt;/strong&gt;&lt;strong&gt;1. public class ClassA {&lt;br /&gt;2.&lt;br /&gt;3. private String design;&lt;br /&gt;4. private Integer data;&lt;br /&gt;5. public String test;&lt;br /&gt;6.&lt;br /&gt;7. public void setClassdata(String design,&lt;br /&gt;8. String test,&lt;br /&gt;9. Integer data) {&lt;br /&gt;10. this.design = design;&lt;br /&gt;11. this.test = test;&lt;br /&gt;12. this.data = data;&lt;br /&gt;13. }&lt;br /&gt;14. }&lt;br /&gt;Which statement is true?&lt;br /&gt;&lt;/strong&gt;A. The class is fully encapsulated.&lt;br /&gt;B. The code demonstrates polymorphism.&lt;br /&gt;C. The test variable breaks encapsulation.&lt;br /&gt;D. The design and data variables break polymorphism.&lt;br /&gt;E. The setClassdata method breaks encapsulation.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;br /&gt;Answer: C&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: 6 Given:&lt;br /&gt;1. package test;&lt;br /&gt;2.&lt;br /&gt;3. class ClassA {&lt;br /&gt;4. public String data = "Java Quiz";&lt;br /&gt;5. }&lt;br /&gt;What can directly access and change the value of the variable data?&lt;br /&gt;&lt;/strong&gt;A. any class&lt;br /&gt;B. only the ClassA class&lt;br /&gt;C. any class in the test package&lt;br /&gt;D. any class that extends ClassA&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;br /&gt;Answer: C&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: 7 Given:&lt;br /&gt;&lt;/strong&gt;&lt;strong&gt;1. class ClassA { public String quiz() { return "answers"; } }&lt;br /&gt;2. class ClassB extends ClassA {&lt;br /&gt;3. public String quiz() { return "Test Answers"; }&lt;br /&gt;4. }&lt;br /&gt;5. class ClassC extends ClassA {&lt;br /&gt;6. public String quiz() { return "Test Data"; }&lt;br /&gt;7. }&lt;br /&gt;...&lt;br /&gt;11. ClassA ClassA = new ClassB();&lt;br /&gt;12. ClassC ClassC = (ClassC)ClassA;&lt;br /&gt;13. System.out.println(ClassC.quiz());&lt;br /&gt;What is the result?&lt;br /&gt;&lt;/strong&gt;A. answers&lt;br /&gt;B. Test Answers&lt;br /&gt;C. Test Data&lt;br /&gt;D. Compilation fails.&lt;br /&gt;E. An exception is thrown at runtime.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;br /&gt;Answer: E&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: 8 Which three statements are true?&lt;br /&gt;&lt;/strong&gt;A. A final method in class ClassA can be abstract if and only if ClassA is abstract.&lt;br /&gt;B. A protected method in class ClassA can be overridden by any subclass of ClassA.&lt;br /&gt;C. A private static method can be called only within other static methods in class ClassA.&lt;br /&gt;D. A non-static public final method in class ClassA can be overridden in any subclass of ClassA.&lt;br /&gt;E. A public static method in class ClassA can be called by a subclass of ClassA without explicitly referencing the class ClassA.&lt;br /&gt;F. A method with the same signature as a private final method in class ClassA can be implemented in a subclass of ClassA.&lt;br /&gt;G. A protected method in class ClassA can be overridden by a subclass of A only if the subclass is in the same package as ClassA.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;br /&gt;Answer: B, E, F&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: 9 Which two statements are true about has-a and is-a relationships? &lt;br /&gt;&lt;/strong&gt;A. Inheritance represents a has-a relationship.&lt;br /&gt;B. Inheritance represents an is-a relationship.&lt;br /&gt;C. Instance variables can be used when creating a has-a relationship.&lt;br /&gt;D.  Interfaces must be used when creating a has-a relationship.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;br /&gt;Answer: B, C&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: 10  Given:&lt;br /&gt;&lt;/strong&gt;&lt;strong&gt;11. Runnable r = new Runnable() {&lt;br /&gt;12. public void testData() {&lt;br /&gt;13. System.out.print("Test Quiz Data");&lt;br /&gt;14. }&lt;br /&gt;15. };&lt;br /&gt;16. Thread t = new Thread(r) {&lt;br /&gt;17. public void testData() {&lt;br /&gt;18. System.out.print("Answer it yourself");&lt;br /&gt;19. }&lt;br /&gt;20. };&lt;br /&gt;21. t.start();&lt;br /&gt;What is the result?&lt;br /&gt;&lt;/strong&gt;A. Test Quiz Data&lt;br /&gt;B. Answer it yourself&lt;br /&gt;C. Compilation fails.&lt;br /&gt;D. The code runs with no output.&lt;br /&gt;E. An exception is thrown at runtime.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;strong&gt;&lt;br /&gt;Answer: B&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Hope you found this useful! Kindly give me your comments regarding the same.Many more Quizzes are yet to be posted! Kindly make use of them as much as possible! &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-6689202281665773296?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/6689202281665773296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=6689202281665773296&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/6689202281665773296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/6689202281665773296'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/09/java-quiz-13.html' title='Java Quiz -13'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-6392182187172237156</id><published>2009-08-31T18:59:00.003+05:30</published><updated>2009-08-31T19:08:46.849+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Preparing For Certification'/><title type='text'>Preparing For SCJP Certification</title><content type='html'>&lt;p&gt;Hi friends,&lt;/p&gt;&lt;p&gt;Today I would like to share my experience both during my preparation and on the day of the SCJP exam which I took on the previous Saturday(29/08/2009).&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;POINT TO NOTE:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;There are totally seven parts that evaluate a candidate in an SCJP test.&lt;br /&gt;&lt;br /&gt;* Declaration,Initialization and scoping&lt;br /&gt;* Flow Control&lt;br /&gt;* API Contents&lt;br /&gt;* Concurrency&lt;br /&gt;* OO Concepts&lt;br /&gt;* Collections/Generics&lt;br /&gt;* Fundamentals&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;PREPARATION:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;First of all I took my certification seriously as this is going to be my first stepping stone.I studied smart and utilized as much time as possible, for the exam.&lt;br /&gt;&lt;br /&gt;I started my preparation about five months back. I started with the book&lt;br /&gt;SCJP Sun Certified Programmer for Java 5 Study Guide (Exam 310-055) by Katherine Sierra and Bert Bates&lt;br /&gt;&lt;br /&gt;To get my Fundamentals strong, I referred the book,&lt;br /&gt;Head First Java by Katherine Sierra and Bert Bates&lt;br /&gt;Both these books cover all the portions that are needed for the SCJP 1.5 exam.&lt;br /&gt;Head first Java was very helpful to understand the concepts and was a good support when I needed a concept in SCJP book to be explained in more detail.&lt;br /&gt;&lt;br /&gt;I also had the help of many of our associates who taught me how to view a problem in the exam.&lt;br /&gt;Two typical examples, &lt;br /&gt;Before starting, I find out problems that can be easily solved and solve them.I solve the rest when I go through it the next time. This ensures that I have a favourable number questions that help me clear the exam, and in the second pass, I concentrate on the rest to ensure that I get as many questions right as possible and score high.&lt;br /&gt;&lt;br /&gt;If I was spending some time on a problem, I make sure that I complete it before proceeding further. This would save a lot of time for going through all the questions again.&lt;br /&gt;&lt;br /&gt;Apart from that I referred to various Mock Tests available online and I made sure that I didnt go by their solution if I felt that the answer given to be confusing.&lt;br /&gt;This helped me a lot and I learnt something new each time I attended one.&lt;br /&gt;I used to solve the code snippets and had found some examples which were given wrong solutions.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;DURING THE EXAM:&lt;br /&gt;&lt;br /&gt;During the exam, I felt the same tension that I had during my degree exam. But I would assure you that you dont have to worry, there is ample time. Three hours for sixty questions and you have choice for the answers too!&lt;br /&gt;&lt;br /&gt;There are two type of questions according to my classification,&lt;br /&gt;One type is  that we have to judge what is the output from a set of choices, and &lt;br /&gt;In Second type, you are given some code snippets and are asked to arrange them in a proper sequence so that you get some specific output.&lt;br /&gt;Especially for the second type, the online questions which I had tested myself earlier came to my   help and I solved them easily.&lt;br /&gt;&lt;br /&gt;Remember that you are not given ant or eclipse in the exam. Everything has to be done by your mind and the paper pad.&lt;br /&gt;&lt;br /&gt;I completed my test in about one and a half hours. At the end of one and a half hours, I was confident of fifty five questions out of sixty to be correct.&lt;br /&gt;&lt;br /&gt;This confidence made me bold and I tried my best on the other five questions.&lt;br /&gt;At the end, As I submitted I got the result immediately and all my tension got subsided on seeing the result.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;MY TOTAL SCORE  93.00%&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ASSESMENT SECTION&lt;br /&gt;SECTION ANALYSIS&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Declaration,Initialization and scoping  90.00%&lt;br /&gt;Flow Control  81.00%&lt;br /&gt;API Contents  100.00%&lt;br /&gt;Concurrency  100.00%&lt;br /&gt;OO Concepts  90.00%&lt;br /&gt;Collections/Generics  100.00%&lt;br /&gt;Fundamentals  100.00%&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-6392182187172237156?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://helptotheneeded.blogspot.com/2009/08/Preparing-For-Certification.html' title='Preparing For SCJP Certification'/><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/6392182187172237156/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=6392182187172237156&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/6392182187172237156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/6392182187172237156'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/08/preparing-for-scjp-certification.html' title='Preparing For SCJP Certification'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-8754540215962812794</id><published>2009-08-30T10:14:00.002+05:30</published><updated>2009-08-30T12:12:00.368+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Quiz'/><title type='text'>Java Quiz-12</title><content type='html'>&lt;p&gt;Hi friends, &lt;br /&gt;&lt;br /&gt;Today I would like to post few more questions to test your capability. &lt;br /&gt;Dont worry guys, I will give you the answer too! Try to answer it yourself without referring to the answers to test yourself.&lt;strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: 1 Given&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;1. // insert code here&lt;br /&gt;2. private N min, max;&lt;br /&gt;3. public N getMin() { return min; }&lt;br /&gt;4. public N getMax() { return max; }&lt;br /&gt;5. public void add(N added) {&lt;br /&gt;6. if (min == null || added.doubleValue() &lt; min.doubleValue()) &lt;br /&gt;7. min = added;&lt;br /&gt;8. if (max == null || added.doubleValue() &gt; max.doubleValue()) &lt;br /&gt;9. max = added;&lt;br /&gt;10. }&lt;br /&gt;Which two, inserted at line 1, will allow the code to compile? (Choose two.)&lt;/strong&gt;&lt;br /&gt;A. public class ClassA&lt;?&gt; {&lt;br /&gt;B. public class ClassA&lt;? extends Number&gt; {&lt;br /&gt;C. public class ClassA&lt;n&gt; {&lt;br /&gt;D. public class ClassA&lt;n&gt; {&lt;br /&gt;E. public class ClassA&lt;? extends Object&gt; {&lt;br /&gt;F. public class ClassA&lt;n&gt; {&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Answer: D, F&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: 2 Given:&lt;br /&gt;1. import java.util.*;&lt;br /&gt;2.&lt;br /&gt;3. public class ClassA{&lt;br /&gt;4. public static void main(String[] args) {&lt;br /&gt;5. ArrayList&lt;string&gt; strings = new ArrayList&lt;string&gt;();&lt;br /&gt;6. strings.add("aAaA");&lt;br /&gt;7. strings.add("AaA");&lt;br /&gt;8. strings.add("aAa");&lt;br /&gt;9. strings.add("AAaa");&lt;br /&gt;10. Collections.sort(strings);&lt;br /&gt;11. for (String data : strings) { System.out.print(data + " "); }&lt;br /&gt;12. }&lt;br /&gt;13. }&lt;br /&gt;What is the result?&lt;/strong&gt;&lt;br /&gt;A. Compilation fails.&lt;br /&gt;B. aAaA aAa AAaa AaA&lt;br /&gt;C. AAaa AaA aAa aAaA&lt;br /&gt;D. AaA AAaa aAaA aAa&lt;br /&gt;E. aAa AaA aAaA AAaa&lt;br /&gt;F. An exception is thrown at runtime.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Answer: C&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: 3 Given:&lt;br /&gt;1. public abstract class ClassA {&lt;br /&gt;2. private int x;&lt;br /&gt;3. private int y;&lt;br /&gt;4. public abstract void quiz();&lt;br /&gt;5. public void test(int x, int y) {&lt;br /&gt;6. this.x = x;&lt;br /&gt;7. this.y = y;&lt;br /&gt;8. }&lt;br /&gt;9. }&lt;br /&gt;Which two classes use the ClassA class correctly? (Choose two.)&lt;br /&gt;&lt;/strong&gt;A. public class ClassB implements ClassA {&lt;br /&gt;private int data;&lt;br /&gt;}&lt;br /&gt;B. public abstract class ClassB extends ClassA {&lt;br /&gt;private int data;&lt;br /&gt;}&lt;br /&gt;C. public class ClassB extends ClassA {&lt;br /&gt;private int data;&lt;br /&gt;public void quiz();&lt;br /&gt;}&lt;br /&gt;D. public abstract class ClassB implements ClassA {&lt;br /&gt;private int data;&lt;br /&gt;public void quiz();&lt;br /&gt;}&lt;br /&gt;E. public class ClassB extends ClassA {&lt;br /&gt;private int data;&lt;br /&gt;public void quiz() {/* code here */}&lt;br /&gt;F. public abstract class ClassB implements ClassA {&lt;br /&gt;private int data;&lt;br /&gt;public void quiz() { /* code here */ }&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;br /&gt;Answer: B, E&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: 4 Given&lt;br /&gt;1. class ClassA {&lt;br /&gt;2. static void questions() { /* more code here */ }&lt;br /&gt;3. void answers() { /* more code here */ }&lt;br /&gt;4. }&lt;br /&gt;Which two statements are true? (Choose two.)&lt;/strong&gt;&lt;br /&gt;A. ClassA.answers() is a valid invocation of answers().&lt;br /&gt;B. ClassA.questions() is a valid invocation of questions().&lt;br /&gt;C. Method answers() can directly call method questions().&lt;br /&gt;D. Method questions() can directly call method answers().&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Answer: B, C&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: 5 Given:&lt;br /&gt;&lt;/strong&gt;&lt;strong&gt;1. class ClassA {&lt;br /&gt;2. public ClassA() { System.out.print(1); }&lt;br /&gt;3. }&lt;br /&gt;4. class ClassB extends ClassA {&lt;br /&gt;5. public ClassB() { System.out.print(2); }&lt;br /&gt;6. }&lt;br /&gt;7. class ClassC extends ClassB {&lt;br /&gt;8. public ClassC() { System.out.print(3); }&lt;br /&gt;9. }&lt;br /&gt;10. public class ClassNumbers{&lt;br /&gt;11. public static void main( String[] args ) { new ClassC(); }&lt;br /&gt;12. }&lt;br /&gt;What is the result when this code is executed?&lt;/strong&gt;&lt;br /&gt;A. 1&lt;br /&gt;B. 3&lt;br /&gt;C. 123&lt;br /&gt;D. 321&lt;br /&gt;E. The code runs with no output.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Answer: C&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: 6 Given:&lt;br /&gt;&lt;/strong&gt;&lt;strong&gt;1. class ClassA{&lt;br /&gt;2. public enum Direction { NORTH, SOUTH, EAST, WEST }&lt;br /&gt;3. }&lt;br /&gt;4. public class ClassB{&lt;br /&gt;5. // insert code here&lt;br /&gt;6. }&lt;br /&gt;Which code, inserted at line 5, allows the ClassB class to compile?&lt;/strong&gt;&lt;br /&gt;A. Direction data = NORTH;&lt;br /&gt;B. ClassA.Direction data = NORTH;&lt;br /&gt;C. Direction data = Direction.NORTH;&lt;br /&gt;D. ClassA.Direction data = ClassA.Direction.NORTH;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Answer: D&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Q: 7 Given:&lt;br /&gt;1. class ClassA {&lt;br /&gt;2. public ClassA classAObj() { return this; }&lt;br /&gt;3. }&lt;br /&gt;4. class ClassB extends ClassA {&lt;br /&gt;5. public ClassA classAObj() { return this; }&lt;br /&gt;6. }&lt;br /&gt;7. class ClassC extends ClassB {&lt;br /&gt;8. // insert method here&lt;br /&gt;9. }&lt;br /&gt;Which ClassB methods, inserted individually, correctly complete the ClassC class? (Choose ClassB.)&lt;/strong&gt;&lt;br /&gt;A. public void classAObj() {}&lt;br /&gt;B. public int classAObj() { return 3; }&lt;br /&gt;C. public ClassB classAObj() { return this; }&lt;br /&gt;D. public ClassA classAObj() { return this; }&lt;br /&gt;E. public Object classAObj() { return this; }&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Answer: C, D&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Q: 8 Given:&lt;br /&gt;1. public static void main(String[] args) {&lt;br /&gt;2. Object obj = new int[] { 1, 2, 3 };&lt;br /&gt;3. int[] dataArray = (int[])obj;&lt;br /&gt;4. for (int data : dataArray) System.out.print(data + " ");&lt;br /&gt;5. }&lt;br /&gt;What is the result?&lt;/strong&gt;&lt;br /&gt;A. 1 2 3&lt;br /&gt;B. Compilation fails because of an error in line 2.&lt;br /&gt;C. Compilation fails because of an error in line 3.&lt;br /&gt;D. Compilation fails because of an error in line 4.&lt;br /&gt;E. A ClassCastException is thrown at runtime.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Answer: A&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: 9 Given:&lt;br /&gt;1. public class ClassA implements Runnable {&lt;br /&gt;2. public void run() {&lt;br /&gt;3. System.out.print("Answer it yourself");&lt;br /&gt;4. }&lt;br /&gt;5. public static void main(String[] args) {&lt;br /&gt;6. Thread t = new Thread(new ClassA());&lt;br /&gt;7. t.run();&lt;br /&gt;8. t.run();&lt;br /&gt;9. t.start();&lt;br /&gt;10. }&lt;br /&gt;11. }&lt;br /&gt;What is the result?&lt;/strong&gt;&lt;br /&gt;A. Compilation fails.&lt;br /&gt;B. An exception is thrown at runtime.&lt;br /&gt;C. The code executes and prints "Answer it yourself".&lt;br /&gt;D. The code executes and prints "Answer it yourselfAnswer it yourself".&lt;br /&gt;E. The code executes and prints "Answer it yourselfAnswer it yourselfAnswer it yourself".&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Answer: E&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: 10 Given:&lt;/strong&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;strong&gt;1. public class ClassA {&lt;/strong&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;strong&gt;2. public static void main (String[] args) throws Exception {&lt;/strong&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;strong&gt;3. Thread.sleep(2000);&lt;/strong&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;strong&gt;4. System.out.println("Java Quiz");&lt;/strong&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;strong&gt;5. }&lt;/strong&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;strong&gt;6. }&lt;/strong&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;strong&gt;What is the result?&lt;/strong&gt;&lt;br /&gt;A. Compilation fails.&lt;br /&gt;B. An exception is thrown at runtime.&lt;br /&gt;C. The code executes normally and prints "Java Quiz".&lt;br /&gt;D. The code executes normally, but nothing is printed.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Answer: C&lt;/strong&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Hope you found this useful! Kindly give me your comments regarding the same.Many more Quizzes are yet to be posted! Kindly make use of them as much as possible! &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-8754540215962812794?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://helptotheneeded.blogspot.com/2009/08/java-quiz-12.html' title='Java Quiz-12'/><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/8754540215962812794/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=8754540215962812794&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/8754540215962812794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/8754540215962812794'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/08/java-quiz-12.html' title='Java Quiz-12'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-7333329358675673670</id><published>2009-08-27T15:53:00.003+05:30</published><updated>2009-08-27T16:01:58.616+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Quiz'/><title type='text'>Java Quiz -11</title><content type='html'>Hi friends,&lt;br /&gt;&lt;br /&gt;Today I would like to post few more questions to test your capability.&lt;br /&gt;Dont worry guys, I will give you the answer too! Try to answer it yourself without referring to the answers to test yourself.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Q: 1 Given:&lt;br /&gt;1. public class ClassA {&lt;br /&gt;2. public static void main(String[] args) {&lt;br /&gt;3. String myProp = /* insert code here */&lt;br /&gt;4. System.out.println(myProp);&lt;br /&gt;5. }&lt;br /&gt;6. }&lt;br /&gt;and the command line:&lt;br /&gt;java -Dprop.custom=apple ClassA&lt;br /&gt;Which two, placed on line 3, will produce the output apple? (Choose two.)&lt;br /&gt;&lt;/b&gt;A. System.getProperty("prop.custom");&lt;br /&gt;B. System.property("prop.custom");&lt;br /&gt;C. System.getProperties().getProperty("prop.custom");&lt;br /&gt;D. System.load("prop.custom");&lt;br /&gt;E. System.getenv("prop.custom")&lt;b&gt;;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Answer: A, C&lt;br /&gt;&lt;br /&gt;Q: 2 Given:&lt;br /&gt;1. class ClassA {&lt;br /&gt;2. ClassB classBobj;&lt;br /&gt;3. public ClassA() { booch = new ClassB(this); }&lt;br /&gt;4. }&lt;br /&gt;5.&lt;br /&gt;6. class ClassB {&lt;br /&gt;7. ClassA classAobj;&lt;br /&gt;8. public ClassB( ClassA s) { classAobj = s; }&lt;br /&gt;9. }&lt;br /&gt;And the statements:&lt;br /&gt;10. public static void main(String[] args) {&lt;br /&gt;11. ClassA classAmainObj = new ClassA();&lt;br /&gt;12. classAmainObj = null;&lt;br /&gt;13. // more code here&lt;br /&gt;14. }&lt;br /&gt;Which statement is true about the objects referenced by classAmainObj, classAobj, and classBobj immediately after line&lt;br /&gt;12 executes?&lt;/b&gt;&lt;b&gt; &lt;/b&gt;&lt;br /&gt;A. Only the object referenced by classAobj is eligible for garbage collection.&lt;br /&gt;B. None of these objects are eligible for garbage collection.&lt;br /&gt;C. The objects referenced by classAobj and classBobj are eligible for garbage collection.&lt;br /&gt;D. Only the object referenced by classBobj is eligible for garbage collection.&lt;br /&gt;E. Only the object referenced by classAmainObj is eligible for garbage collection.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Answer: E&lt;br /&gt;&lt;br /&gt;Q: 3 Given:&lt;br /&gt;1. public class ClassA {&lt;br /&gt;2.&lt;br /&gt;3. static public void main(String [] args) {&lt;br /&gt;4. for(int x = 1; x &amp;lt; args.length; x++) {&lt;br /&gt;5. System.out.print(args[x] + " ");&lt;br /&gt;6. }&lt;br /&gt;7. }&lt;br /&gt;8. }&lt;br /&gt;and the command line invocation:&lt;br /&gt;java ClassA a b c&lt;br /&gt;What is the result?&lt;/b&gt;&lt;br /&gt;A. a b&lt;br /&gt;B. b c&lt;br /&gt;C. a b c&lt;br /&gt;D. Compilation fails.&lt;br /&gt;E. An exception is thrown at runtime.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Answer: B&lt;br /&gt;&lt;br /&gt;Q: 4 A developer is creating a class ClassA, that needs to access class ClassB. The&lt;br /&gt;ClassB class is deployed in a JAR named quiz.jar. Which three, taken independently, will allow the developer to use the ClassB class while compiling the ClassA class? (Choose three.)&lt;/b&gt;&lt;br /&gt;A. The JAR file is located at $JAVA_HOME/jre/classes/quiz.jar.&lt;br /&gt;B. The JAR file is located at $JAVA_HOME/jre/lib/ext/quiz.jar.&lt;br /&gt;C. The JAR file is located at /foo/quiz.jar and a classpath environment variable is set that includes&lt;br /&gt;/foo/quiz.jar/ClassB.class.&lt;br /&gt;D. The JAR file is located at /foo/quiz.jar and a classpath environment variable is set that includes&lt;br /&gt;/foo/quiz.jar.&lt;br /&gt;E. The JAR file is located at /foo/quiz.jar and the ClassA class is compiled using javac -cp /foo/quiz.jar/ClassB&lt;br /&gt;ClassA.java.&lt;br /&gt;F. The JAR file is located at /foo/quiz.jar and the ClassA class is compiled using javac -d /foo/quiz.jar&lt;br /&gt;ClassA.java&lt;br /&gt;G. The JAR file is located at /foo/quiz.jar and the ClassA class is compiled using javac -classpath&lt;br /&gt;/foo/quiz.jar ClassA.java&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Answer: B, D, G&lt;br /&gt;&lt;br /&gt;Q: 5 Given:&lt;br /&gt;enum Example { Questions,Answers,Test }&lt;br /&gt;Which statement is true?&lt;br /&gt;&lt;/b&gt;A. The expressions (Questions == Questions) and Questions.equals(Questions) are both guaranteed to be true.&lt;br /&gt;B. The expression (Questions &amp;lt; Answers) is guaranteed to be true and Questions.compareTo(Answers) is guaranteed to be less&lt;br /&gt;than Questions.&lt;br /&gt;C. The Example values cannot be used in a raw java.util.HashMap; instead, the programmer must use a&lt;br /&gt;java.util.EnumMap.&lt;br /&gt;D. The Example values can be used in a java.util.SortedSet, but the set will NOT be sorted because enumerated types do NOT implement java.lang.Comparable.&lt;b&gt;&lt;br /&gt;&lt;br /&gt;Answer: A&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Q: 6 Given:&lt;br /&gt;1. import java.util.*;&lt;br /&gt;2. public class ClassA {&lt;br /&gt;3. public static void main(String[] args) {&lt;br /&gt;4. PriorityQueue&lt;string&gt; data = new PriorityQueue&lt;string&gt;();&lt;br /&gt;5. data.add("Test");&lt;br /&gt;6. data.add("Questions");&lt;br /&gt;7. data.add("Answers");&lt;br /&gt;8. System.out.println(data.poll() + ":" + data.peek());&lt;br /&gt;9. }&lt;br /&gt;10. }&lt;br /&gt;What is the result?&lt;br /&gt;&lt;/string&gt;&lt;/string&gt;&lt;/b&gt;&lt;string&gt;&lt;string&gt;A. Questions:Questions&lt;br /&gt;B. Test:Questions&lt;br /&gt;C. Questions:Answers&lt;br /&gt;D. Answers:Questions&lt;br /&gt;E. Test:Test&lt;br /&gt;F. Test:Answers&lt;/string&gt;&lt;/string&gt;&lt;b&gt;&lt;string&gt;&lt;string&gt;&lt;br /&gt;&lt;br /&gt;&lt;/string&gt;&lt;/string&gt;&lt;/b&gt;&lt;p&gt;&lt;b&gt;&lt;string&gt;&lt;string&gt;&lt;b&gt;Answer: C&lt;/b&gt;&lt;/string&gt;&lt;/string&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;string&gt;&lt;string&gt;&lt;b&gt;Q: 7 Given:&lt;br /&gt;&lt;/b&gt;&lt;/string&gt;&lt;/string&gt;&lt;/b&gt;&lt;/p&gt;&lt;b&gt;&lt;string&gt;&lt;string&gt;&lt;b&gt;1. Object [] data = {&lt;br /&gt;2. new Integer(12),&lt;br /&gt;3. new String("foo"),&lt;br /&gt;4. new Integer(5),&lt;br /&gt;5. new Boolean(true)&lt;br /&gt;6. };&lt;br /&gt;7. Arrays.sort(data);&lt;br /&gt;8. for(int i=0; i&lt;data br=""&gt;9. System.out.print(data[i].toString());&lt;br /&gt;10. System.out.print(" ");&lt;br /&gt;11. }&lt;br /&gt;What is the result?&lt;br /&gt;&lt;/data&gt;&lt;/b&gt;&lt;/string&gt;&lt;/string&gt;&lt;/b&gt;&lt;string&gt;&lt;string&gt;&lt;data br=""&gt;A. Compilation fails due to an error in line 1.&lt;br /&gt;B. Compilation fails due to an error in line 7.&lt;br /&gt;C. A ClassCastException occurs in line 7.&lt;br /&gt;D. A ClassCastException occurs in line 5.&lt;br /&gt;E. The value of all four objects will be printed.&lt;/data&gt;&lt;/string&gt;&lt;/string&gt;&lt;b&gt;&lt;string&gt;&lt;string&gt;&lt;b&gt;&lt;data br=""&gt;&lt;b&gt;&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;/data&gt;&lt;/b&gt;&lt;/string&gt;&lt;/string&gt;&lt;/b&gt;&lt;p&gt;&lt;b&gt;&lt;string&gt;&lt;string&gt;&lt;b&gt;&lt;data br=""&gt;&lt;b&gt;Answer: C&lt;/b&gt;&lt;/data&gt;&lt;/b&gt;&lt;/string&gt;&lt;/string&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: 8 Given:&lt;br /&gt;1. import java.util.*;&lt;br /&gt;2. public class ClassA {&lt;br /&gt;3. private String s;&lt;br /&gt;4. public ClassA(String s) { this.s = s; }&lt;br /&gt;5. public static void main(String[] args) {&lt;br /&gt;6. HashSet&lt;object&gt; test = new HashSet&lt;object&gt;();&lt;br /&gt;7. ClassA classAobj1 = new ClassA("aardvark");&lt;br /&gt;8. ClassA classAobj2 = new ClassA("aardvark");&lt;br /&gt;9. String s1 = new String("aardvark");&lt;br /&gt;10. String s2 = new String("aardvark");&lt;br /&gt;11. test.add(classAobj1); test.add(classAobj2); test.add(s1); test.add(s2);&lt;br /&gt;12. System.out.println(test.size()); } }&lt;br /&gt;What is the result?&lt;/strong&gt;&lt;br /&gt;A. 0&lt;br /&gt;B. 1&lt;br /&gt;C. 2&lt;br /&gt;D. 3&lt;br /&gt;E. 4&lt;br /&gt;F. Compilation fails.&lt;br /&gt;G. An exception is thrown at runtime.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Answer: D  &lt;/strong&gt;&lt;b&gt;&lt;string&gt;&lt;string&gt;&lt;b&gt;&lt;data br=""&gt;&lt;br /&gt;&lt;/data&gt;&lt;/b&gt;&lt;/string&gt;&lt;/string&gt;&lt;/b&gt;&lt;/p&gt;&lt;b&gt;&lt;string&gt;&lt;string&gt;&lt;b&gt;&lt;data br=""&gt;&lt;b&gt;&lt;string&gt;&lt;string&gt;&lt;b&gt;&lt;data br=""&gt;&lt;b&gt;Q: 9 Given:&lt;br /&gt;1. public class ClassA {&lt;br /&gt;2. private long data1;&lt;br /&gt;3. private long data2;&lt;br /&gt;4.&lt;br /&gt;5. // class ClassA methods&lt;br /&gt;6. }&lt;br /&gt;A programmer is developing a class ClassA, that will be used as a ClassA in a standard java.util.HashMap.&lt;br /&gt;Which two methods should be overridden to assure that ClassA works correctly as a ClassA? (Choose two.)&lt;/b&gt;&lt;br /&gt;&lt;/data&gt;&lt;/b&gt;&lt;/string&gt;&lt;/string&gt;&lt;/b&gt;&lt;/data&gt;&lt;/b&gt;&lt;/string&gt;&lt;/string&gt;&lt;/b&gt;&lt;string&gt;&lt;string&gt;&lt;data br=""&gt;&lt;string&gt;&lt;string&gt;&lt;data br=""&gt;A. public int hashCode()&lt;br /&gt;B. public boolean equals(ClassA k)&lt;br /&gt;C. public int compareTo(Object o)&lt;br /&gt;D. public boolean equals(Object o)&lt;br /&gt;E. public boolean compareTo(ClassA k)&lt;/data&gt;&lt;/string&gt;&lt;/string&gt;&lt;/data&gt;&lt;/string&gt;&lt;/string&gt;&lt;b&gt;&lt;string&gt;&lt;string&gt;&lt;b&gt;&lt;data br=""&gt;&lt;b&gt;&lt;string&gt;&lt;string&gt;&lt;b&gt;&lt;data br=""&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Answer: A, D&lt;br /&gt;&lt;br /&gt;Q: 10 Given a pre-generics implementation of a method:&lt;br /&gt;1. public static int data(List list) {&lt;br /&gt;2. int data = 0;&lt;br /&gt;3. for ( Iterator iter = list.iterator(); iter.hasNext(); ) {&lt;br /&gt;4. int i = ((Integer)iter.next()).intValue();&lt;br /&gt;5. data += i;&lt;br /&gt;6. }&lt;br /&gt;7. return data;&lt;br /&gt;8. }&lt;br /&gt;Which three changes must be made to the method data to use generics? (Choose three.)&lt;/b&gt;&lt;br /&gt;&lt;b&gt; &lt;/b&gt;&lt;br /&gt;&lt;/data&gt;&lt;/b&gt;&lt;/string&gt;&lt;/string&gt;&lt;/b&gt;&lt;/data&gt;&lt;/b&gt;&lt;/string&gt;&lt;/string&gt;&lt;/b&gt;&lt;string&gt;&lt;string&gt;&lt;data br=""&gt;&lt;string&gt;&lt;string&gt;&lt;data br=""&gt;A. remove line 4&lt;br /&gt;B. replace line 4 with "int i = iter.next();"&lt;br /&gt;C. replace line 3 with "for (int i : intList) {"&lt;br /&gt;D. replace line 3 with "for (Iterator iter : intList) {"&lt;br /&gt;E. replace the method declaration with "data(List&lt;int&gt; intList)"&lt;br /&gt;F. replace the method declaration with "data(List&lt;integer&gt; intList)"&lt;/integer&gt;&lt;/int&gt;&lt;/data&gt;&lt;/string&gt;&lt;/string&gt;&lt;/data&gt;&lt;/string&gt;&lt;/string&gt;&lt;b&gt;&lt;string&gt;&lt;string&gt;&lt;b&gt;&lt;data br=""&gt;&lt;b&gt;&lt;string&gt;&lt;string&gt;&lt;b&gt;&lt;data br=""&gt;&lt;int&gt;&lt;integer&gt;&lt;br /&gt; &lt;b&gt;Answer: A, C, F&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Hope you found this useful! Kindly give me your comments regarding the same.Many more Quizzes are yet to be posted! Kindly make use of them as much as possible!&lt;/integer&gt;&lt;/int&gt;&lt;/data&gt;&lt;/b&gt;&lt;/string&gt;&lt;/string&gt;&lt;/b&gt;&lt;b&gt; &lt;/b&gt;&lt;/data&gt;&lt;/b&gt;&lt;/string&gt;&lt;/string&gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-7333329358675673670?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://helptotheneeded.blogspot.com/2009/08/java-quiz-11.html' title='Java Quiz -11'/><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/7333329358675673670/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=7333329358675673670&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/7333329358675673670'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/7333329358675673670'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/08/java-quiz-11.html' title='Java Quiz -11'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-7194299043178825545</id><published>2009-08-26T11:24:00.005+05:30</published><updated>2009-08-26T11:32:50.938+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Few Points Related To Design Patterns</title><content type='html'>Hi friends,&lt;br /&gt;&lt;br /&gt;Its been sometime since we shared some information regarding the concepts(For those who missed out, We had been doing Few Java Quizzes! Check It out Here &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;http://helptotheneeded.blogspot.com/search/label/Java%20Quiz&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Today I would like to present a general hint which would be helpful for people who want to take seminars in Design Patterns.&lt;br /&gt;&lt;br /&gt;Without wasting further time, Here We Go!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Before Design Pattern:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Interface – Car and TV remote&lt;br /&gt;Abstract Class – I10 &lt;br /&gt;Is a - has a&lt;br /&gt;Aggregation - If the History-Class object is destroyed, the Student objects may continue to exist. &lt;br /&gt;History-Class &lt;&lt; ---&gt;Student&lt;br /&gt;(Weak relationship)&lt;br /&gt;Composition - If the House object is destroyed, the Room objects will also be destroyed.&lt;br /&gt;(Strong relationship) House &lt;&lt; --- &gt; Room&lt;br /&gt;&lt;br /&gt;Architecture – Skeletal view &lt;br /&gt;Framework – Implementation&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Organizing the patterns:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Creational – Involve object instantiation and all provide a way to decouple a client from the objects &lt;br /&gt;it needs to instantiate.&lt;br /&gt;Behavioral – It is concerned with how classes and objects interact and distribute responsibility.&lt;br /&gt;Structural – It lets you compose classes or objects into larger structures.&lt;br /&gt;&lt;br /&gt;GOF – Gang of four (Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides) author’s of the book&lt;br /&gt;&lt;br /&gt;There are 250 patterns in oo world where 23 are familiar and well known patterns.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Creational:&lt;br /&gt;Singleton:&lt;/span&gt;&lt;br /&gt;  “Ensure  a class has one instance and provide a global point of access to it”&lt;br /&gt; public class  single {&lt;br /&gt;    private static single  s;&lt;br /&gt;             private single() {   };&lt;br /&gt;   &lt;br /&gt;   public static synchronized single getInstance()&lt;br /&gt;   {&lt;br /&gt;    if(s==null) &lt;br /&gt;      s = new single();&lt;br /&gt;    return s; &lt;br /&gt;   }&lt;br /&gt;   //other methods continue here&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Factory Method:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Based on your data, we are going to instaniate an object of a classes &lt;br /&gt;eg:&lt;br /&gt;Car&lt;- Buick, Chevrolet, Ford, Pontiac and Saturn&lt;br /&gt;public class OrderCars&lt;br /&gt; {&lt;br /&gt; public Car orderCar(String model)&lt;br /&gt;  {&lt;br /&gt;  Car car;&lt;br /&gt;  if(model.equals("Lucerne"))&lt;br /&gt;   car = new Buick(model);&lt;br /&gt;  else if(model.equals("Corvette"))&lt;br /&gt;   car = new Chevrolet(model);&lt;br /&gt;  else if(model.equals("Fusion"))&lt;br /&gt;   car = new Ford(model);&lt;br /&gt;  else if(model.equals("GTO"))&lt;br /&gt;   car = new Pontiac(model);&lt;br /&gt;  else if(model.equals("Vue"))&lt;br /&gt;   car = new Saturn(model);&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;When a class does not know which class of objects it must create.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Abstract Factory:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Its a super set of Factory method pattern&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;public class ComputerType {&lt;br /&gt;private Computer comp; &lt;br /&gt;public static void main(String[] args) {&lt;br /&gt;ComputerType type = new ComputerType(); &lt;br /&gt;Computer computer = type.getComputer("Server");&lt;br /&gt;System.out.println("Monitor: "+computer.getMonitor().getSpecification());&lt;br /&gt;System.out.println("RAM: "+computer.getRAM().getSpecification());&lt;br /&gt;System.out.println("Processor: "+computer.getProcessor().getSpecification());&lt;br /&gt;} &lt;br /&gt;/**&lt;br /&gt;* Returns a computer for a type&lt;br /&gt;*&lt;br /&gt;* @param computerType String, PC / Workstation / Server&lt;br /&gt;* @return Computer&lt;br /&gt;*/&lt;br /&gt;public Computer getComputer(String computerType) { if (computerType.equals("PC"))&lt;br /&gt;comp = new PC();&lt;br /&gt;else if(computerType.equals("Workstation"))&lt;br /&gt;comp = new Workstation();&lt;br /&gt;else if(computerType.equals("Server"))&lt;br /&gt;comp = new Server(); &lt;br /&gt;return comp;&lt;br /&gt;} }// End of class&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Builder and Prototype&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Behavioral:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Strategy  - It desines a set of algorithm and make them interchangable based on client request (refer ppt )&lt;br /&gt;Observer - Refer ppt It defines a one-to-many dependency between objects so that when one object change state,&lt;br /&gt; all of its dependents are notified and updated automatically (refer ppt)&lt;br /&gt;Chain of Responsibility , Command , Interpreter , Iterator , Mediator, Memento &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Structural:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Adapter:  It converts the interface of a class into another interface the client expects. Adapter lets &lt;br /&gt;classes work together that couldn’t otherwise because of incompatible interfaces (refer ppt )&lt;br /&gt;Façade: This is nothing but the outlook of an object.It hides the complexity of our implementation&lt;br /&gt;(refer ppt ).&lt;br /&gt;&lt;br /&gt;Bridge ,Composite, Decorator, Façade, Flyweight and Proxy  &lt;br /&gt;&lt;br /&gt;This Information As Said Earlier is only a general hint which would be helpful for people who want to take seminars.&lt;br /&gt;Hope It was useful to you, Please Post your comments!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-7194299043178825545?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/7194299043178825545/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=7194299043178825545&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/7194299043178825545'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/7194299043178825545'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/08/few-points-related-to-design-patterns.html' title='Few Points Related To Design Patterns'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-678017273844434685</id><published>2009-08-25T09:08:00.002+05:30</published><updated>2009-08-25T09:12:38.011+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Quiz'/><title type='text'>Java Quiz -10</title><content type='html'>Hi friends, &lt;br /&gt;&lt;br /&gt;Today I would like to post few more questions to test your capability. &lt;br /&gt;Dont worry guys, I will give you the answer too! Try to answer it yourself without referring to the answers to test yourself.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 1 Given: &lt;br /&gt;1.public class TestString3{ &lt;br /&gt;2. public static void main(String[] args) {&lt;br /&gt;3.// insert code here&lt;br /&gt;4.System.out.println(s); &lt;br /&gt;5.} &lt;br /&gt;6.} Which two code fragments, inserted&lt;br /&gt;independently at line 3, generate the output 4247? (Choose two.)&lt;/span&gt;&lt;br /&gt;A. StringBuffer s = new StringBuffer("123456789");&lt;br /&gt;   s.substring(3,6).delete(1,3).insert(1, "24");&lt;br /&gt;B. StringBuffer s = new StringBuffer("123456789");&lt;br /&gt;   s.delete(0,3).replace(1,3,"24").delete(4,6);&lt;br /&gt;C. String s = "123456789";&lt;br /&gt;   s = (s-"123").replace(1,3,"24") - "89";&lt;br /&gt;D. StringBuilder s = new StringBuilder("123456789");&lt;br /&gt;   s.substring(3,6).delete(1,2).insert(1, "24");&lt;br /&gt;E. StringBuilder s = new StringBuilder("123456789");&lt;br /&gt;   s.delete(0,3).delete(1,3).delete(2,5).insert(1, "24");&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: B, E&lt;br /&gt;&lt;br /&gt;Q: 2 When comparing java.io.BufferedWriter to java.io.FileWriter, which&lt;br /&gt;capability exists as a method in only one of the two?&lt;/span&gt;&lt;br /&gt;A. writing a line separator to the stream&lt;br /&gt;B. writing to the stream&lt;br /&gt;C. marking a location in the stream&lt;br /&gt;D. flushing the stream&lt;br /&gt;E. closing the stream&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: A&lt;br /&gt;&lt;br /&gt;Q: 3 Given:&lt;br /&gt;12. Date date = new Date();&lt;br /&gt;13. df.setLocale(Locale.ITALY);&lt;br /&gt;14. String s = df.format(date);&lt;br /&gt;The variable df is an object of type DateFormat that has been initialized in line 11.&lt;br /&gt;What is the result if this code is run on December 14, 2000?&lt;/span&gt;&lt;br /&gt;A. The value of s is Dec 14, 2000.&lt;br /&gt;B. The value of s is 14-dec-2004.&lt;br /&gt;C. Compilation fails because of an error in line 13.&lt;br /&gt;D. An exception is thrown at runtime.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: C&lt;br /&gt;&lt;br /&gt;Q: 4 Which three statements concerning the use of the java.io.Serializable&lt;br /&gt;interface are true? (Choose three.)&lt;/span&gt;&lt;br /&gt;A. An object serialized on one JVM can be successfully deserialized on a different JVM.&lt;br /&gt;B. The values in fields with the transient modifier will NOT survive serialization and deserialization.&lt;br /&gt;C. It is legal to serialize an object of a type that has a supertype that does NOT implement java.io.Serializable.&lt;br /&gt;D. Objects from classes that use aggregation cannot be serialized.&lt;br /&gt;E. The values in fields with the volatile modifier will NOT survive serialization and deserialization.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: A, B, C&lt;br /&gt;&lt;br /&gt;Q: 5 Given:&lt;br /&gt;11. String test = "This is a test";&lt;br /&gt;12. String[] tokens = test.split("\s");&lt;br /&gt;13. System.out.println(tokens.length);&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. 10&lt;br /&gt;B. 2&lt;br /&gt;C. 5&lt;br /&gt;D. Compilation fails.&lt;br /&gt;E. An exception is thrown at runtime.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: D&lt;br /&gt;&lt;br /&gt;Q: 6 Given:&lt;br /&gt;d is a valid, non-null Date object&lt;br /&gt;df is a valid, non-null DateFormat object set to the current locale&lt;br /&gt;What outputs the current locale's country name and the appropriate version of d's date?&lt;/span&gt;&lt;br /&gt;A. Locale loc = Locale.getDefault();&lt;br /&gt;System.out.println(loc.getDisplayCountry()&lt;br /&gt;+ " " + df.format(d));&lt;br /&gt;B.  Locale loc = Locale.getLocale();&lt;br /&gt;System.out.println(loc.getDisplayCountry()&lt;br /&gt;+ " " + df.setDateFormat(d));&lt;br /&gt;C. Locale loc = Locale.getDefault();&lt;br /&gt;System.out.println(loc.getDisplayCountry()&lt;br /&gt;+ " " + df.setDateFormat(d));&lt;br /&gt;D. Locale loc = Locale.getLocale();&lt;br /&gt;System.out.println(loc.getDisplayCountry()&lt;br /&gt;+ " " + df.format(d));&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: A&lt;br /&gt;&lt;br /&gt;Q: 7 Given classes defined in two different files:&lt;br /&gt;1. package util;&lt;br /&gt;2. public class ClassA {&lt;br /&gt;3. private static void process(byte[] b) {}&lt;br /&gt;4. }&lt;br /&gt;1. package app;&lt;br /&gt;2. public class ClassB {&lt;br /&gt;3. public static void main(String[] args) {&lt;br /&gt;4. byte[] byteobj = new byte[256];&lt;br /&gt;5. // insert code here&lt;br /&gt;6. }&lt;br /&gt;7. }&lt;br /&gt;What is required at line 5 in class SomeApp to use the process method of ClassB?&lt;/span&gt;&lt;br /&gt;A. process(byteobj);&lt;br /&gt;B. ClassB.process(byteobj);&lt;br /&gt;C. app.ClassB.process(byteobj);&lt;br /&gt;D. util.ClassB.process(byteobj);&lt;br /&gt;E. import util.ClassB.*; process(byteobj);&lt;br /&gt;F. SomeApp cannot use the process method in ClassB.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: F&lt;br /&gt;&lt;br /&gt;Q: 8 Given:&lt;br /&gt;1. rbo = new ReallyBigObject();&lt;br /&gt;2. // more code here&lt;br /&gt;3. rbo = null;&lt;br /&gt;4. /* insert code here */&lt;br /&gt;Which statement should be placed at line 4 to suggest that the virtual machine expend effort toward recycling the memory used by the object rbo?&lt;/span&gt;&lt;br /&gt;A. Runtime.getRuntime().growHeap();&lt;br /&gt;B. System.freeMemory();&lt;br /&gt;C. Runtime.getRuntime().freeMemory();&lt;br /&gt;D. System.gc();&lt;br /&gt;E. Runtime.gc();&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: D&lt;br /&gt;&lt;br /&gt;Q: 9 Given classes defined in two different files:&lt;br /&gt;1. package util;&lt;br /&gt;2. public class ClassB {&lt;br /&gt;3. public static void process(byte[]) { /* more code here */ }&lt;br /&gt;4. }&lt;br /&gt;1. package app;&lt;br /&gt;2. public class ClassA {&lt;br /&gt;3. public static void main(String[] args) {&lt;br /&gt;4. byte[] byteobj = new byte[256];&lt;br /&gt;5. // insert code here&lt;br /&gt;6. }&lt;br /&gt;7. }&lt;br /&gt;What is required at line 5 in class ClassA to use the process method of ClassB?&lt;/span&gt;&lt;br /&gt;A. ClassB.process(byteobj);&lt;br /&gt;B. util.ClassB.process(byteobj);&lt;br /&gt;C. process(byteobj);&lt;br /&gt;D. import util.ClassB.*; process(byteobj);&lt;br /&gt;E. SomeApp cannot use methods in ClassB.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: B&lt;br /&gt;&lt;br /&gt;Q: 10 Given:&lt;br /&gt;11. public static void test(String string) {&lt;br /&gt;12. int value = 4;&lt;br /&gt;13. if ( value = string.length()) {&lt;br /&gt;14. System.out.print(string .charAt( value -= 1) +", ");&lt;br /&gt;15. } else {&lt;br /&gt;16. System.out.print(string .charAt(0) + ", ");&lt;br /&gt;17. }&lt;br /&gt;18. }&lt;br /&gt;and the invocation:&lt;br /&gt;21. test("four");&lt;br /&gt;22. test("tee");&lt;br /&gt;23. test("to");&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. r, e, o,&lt;br /&gt;B.  r, t, t,&lt;br /&gt;C. Compilation fails.&lt;br /&gt;D. An exception is thrown at runtime.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: C&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Hope you found this useful! Kindly give me your comments regarding the same.Many more Quizzes are yet to be posted! Kindly make use of them as much as possible!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-678017273844434685?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/678017273844434685/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=678017273844434685&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/678017273844434685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/678017273844434685'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/08/java-quiz-10.html' title='Java Quiz -10'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-7147462317292873077</id><published>2009-08-24T09:33:00.001+05:30</published><updated>2009-08-24T09:35:12.926+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Quiz'/><title type='text'>Java Quiz-9</title><content type='html'>Hi friends, &lt;br /&gt;&lt;br /&gt;Today I would like to post few more questions to test your capability. &lt;br /&gt;Dont worry guys, I will give you the answer too! Try to answer it yourself without referring to the answers to test yourself.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;1)What is the output of following code&lt;br /&gt;&lt;br /&gt;class MyOuter&lt;br /&gt;{&lt;br /&gt;  private int x = 7;&lt;br /&gt;&lt;br /&gt;  public void makeInner()&lt;br /&gt;  {&lt;br /&gt;    MyInner in = new MyInner();&lt;br /&gt;    in.seeOuter();&lt;br /&gt;    System.out.println(x);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  class MyInner&lt;br /&gt;  {&lt;br /&gt;    public void seeOuter()&lt;br /&gt;    {&lt;br /&gt;      x += (++x + x++);&lt;br /&gt;      System.out.println(x++);&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  public static void main(String [] args)&lt;br /&gt;  {&lt;br /&gt;    MyOuter outer = new MyOuter();&lt;br /&gt;    outer.makeInner();&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Ans&lt;/span&gt;&lt;br /&gt;23&lt;br /&gt;24&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;2)Write code to fill up the blanks&lt;br /&gt;&lt;br /&gt;class MyOuter &lt;br /&gt;{&lt;br /&gt;   private int x = 7;&lt;br /&gt;&lt;br /&gt;   public void makeInner() {&lt;br /&gt;      MyInner in = new MyInner();&lt;br /&gt;      in.seeOuter();&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   class MyInner &lt;br /&gt;   {&lt;br /&gt;      public void seeOuter() &lt;br /&gt;      {&lt;br /&gt;         System.out.println("Outer x is " + x);&lt;br /&gt;      }&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;  public static void main(String[] args) &lt;br /&gt;  {&lt;br /&gt;    MyOuter mo = new MyOuter();&lt;br /&gt;    _______ inner = ___________;&lt;br /&gt;    inner.seeOuter();&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Ans&lt;/span&gt;&lt;br /&gt;MyOuter.MyInner&lt;br /&gt;mo.new MyInner()&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;3)What is the output of the following code?&lt;br /&gt;&lt;br /&gt;class Popcorn &lt;br /&gt;{&lt;br /&gt;   public void pop() &lt;br /&gt;   {&lt;br /&gt;      System.out.println("popcorn");&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class Food &lt;br /&gt;{&lt;br /&gt;   Popcorn p = new Popcorn() &lt;br /&gt;   {&lt;br /&gt;      public void sizzle () &lt;br /&gt;      {&lt;br /&gt;        System.out.println("anonymous sizzling popcorn");&lt;br /&gt;      }&lt;br /&gt;      public void pop() &lt;br /&gt;      {&lt;br /&gt;         System.out.println("anonymous popcorn");&lt;br /&gt;      }&lt;br /&gt;   };&lt;br /&gt;&lt;br /&gt;   public void popIt() &lt;br /&gt;   {&lt;br /&gt;      p.pop();   &lt;br /&gt;      p.sizzle();&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Ans&lt;/span&gt;&lt;br /&gt;-----&lt;br /&gt;p.sizzle() will result in compilation error: cannot resolve symbol&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;4) Which are true about a static nested class? (Choose all that apply.)&lt;br /&gt;&lt;br /&gt;A. You must have a reference to an instance of the enclosing class in order &lt;br /&gt;   to instantiate it.&lt;br /&gt;&lt;br /&gt;B. It does not have access to non-static members of the enclosing class.&lt;br /&gt;&lt;br /&gt;C. Its variables and methods must be static.&lt;br /&gt;&lt;br /&gt;D. If the outer class is named MyOuter, and the nested class is named    &lt;br /&gt;   MyInner, it can be instantiated using new MyOuter.MyInner();. &lt;br /&gt;&lt;br /&gt;E. It must extend the enclosing class.&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Ans&lt;/span&gt;&lt;br /&gt;B and D&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;5)What is the problem with the following code?&lt;br /&gt;&lt;br /&gt;class FooRunnable implements Runnable &lt;br /&gt;{&lt;br /&gt;   public void run() &lt;br /&gt;   {&lt;br /&gt;      for(int x =1; x &lt; 6; x++) &lt;br /&gt;      {&lt;br /&gt;        System.out.println("Runnable running");&lt;br /&gt;      }&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class TestThreads &lt;br /&gt;{&lt;br /&gt;   public static void main (String [] args) &lt;br /&gt;   {&lt;br /&gt;     FooRunnable r = new FooRunnable();&lt;br /&gt;     r.run();&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Ans&lt;/span&gt;&lt;br /&gt;We are not creating Threads here. The programs runs single-threaded.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;6)What should you do to make the run() method in the following code&lt;br /&gt;to be thread-safe?&lt;br /&gt;&lt;br /&gt;class NameRunnable implements Runnable &lt;br /&gt;{&lt;br /&gt;    public void run() &lt;br /&gt;    {&lt;br /&gt;        for (int x = 1; x &lt;= 3; x++) &lt;br /&gt;        {&lt;br /&gt;            System.out.println("Run by "&lt;br /&gt;                    + Thread.currentThread().getName()&lt;br /&gt;                    + ", x is " + x);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Ans&lt;/span&gt;&lt;br /&gt;Nothing. The method is already thread-safe.&lt;br /&gt;&lt;br /&gt;Hope you found this useful! Kindly give me your comments regarding the same.Many more Quizzes are yet to be posted! Kindly make use of them as much as possible!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-7147462317292873077?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/7147462317292873077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=7147462317292873077&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/7147462317292873077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/7147462317292873077'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/08/java-quiz-9.html' title='Java Quiz-9'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-607749608831175390</id><published>2009-08-21T14:30:00.002+05:30</published><updated>2009-08-21T14:33:21.327+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Quiz'/><title type='text'>Java Quiz -8</title><content type='html'>Hi friends, &lt;br /&gt;&lt;br /&gt;Today I would like to post few more questions to test your capability. &lt;br /&gt;Dont worry guys, I will give you the answer too! Try to answer it yourself without referring to the answers to test yourself.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;1)I have class called GlobalCache in package com.planetsoft.cache.&lt;br /&gt;I want to print the name of the class, without creating an object&lt;br /&gt;of the class.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Ans:&lt;/span&gt; GlobalCache.class.getName()&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;2)What is the output of the following program?&lt;br /&gt;&lt;br /&gt;System.out.println("value=" + 08);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Ans:&lt;/span&gt; Compilation Error: Octal digit out of range&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;3)What is the output of the following code  &lt;br /&gt;&lt;br /&gt;private void display()&lt;br /&gt;{&lt;br /&gt;  int ret = catchMe(true);&lt;br /&gt;  System.out.println("ret=" + ret);&lt;br /&gt;&lt;br /&gt;  ret = catchMe(false);&lt;br /&gt;  System.out.println("ret=" + ret);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;private int catchMe(boolean cond)&lt;br /&gt;{&lt;br /&gt;  &lt;br /&gt;  try&lt;br /&gt;  {&lt;br /&gt;    if (cond) throw new Exception("catch me");&lt;br /&gt;    return 1;&lt;br /&gt;  }&lt;br /&gt;  catch(Exception ex)&lt;br /&gt;  {&lt;br /&gt;    return 2;&lt;br /&gt;  }&lt;br /&gt;  finally&lt;br /&gt;  {&lt;br /&gt;    return 3;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Ans:&lt;/span&gt;&lt;br /&gt;ret=3&lt;br /&gt;ret=3&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;5)What is wrong in the following code? suggest a solution to fix it&lt;br /&gt;&lt;br /&gt;public static void display() &lt;br /&gt;{&lt;br /&gt;  final long MICROS_PER_DAY = 24 * 60 * 60 * 1000 * 1000;&lt;br /&gt;  final long MILLIS_PER_DAY = 24 * 60 * 60 * 1000;&lt;br /&gt;  System.out.println(MICROS_PER_DAY / MILLIS_PER_DAY);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Ans:&lt;/span&gt;&lt;br /&gt;The problem is arithmetic overflow. Solution is to prefix the&lt;br /&gt;numbers with L, to make the computation in long arithmetic.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;6)Mr. Jack has a  15cm gold bar and wants to give Mr. Jill, 1 cm&lt;br /&gt;of gold bar on day 1, 2cms of gold bar on day 2, and so on..., .Finally&lt;br /&gt;Mr. Jack should give away 15 cms of gold bar on day 15. &lt;br /&gt;Following are the rules&lt;br /&gt;a)Mr. Jack can make at the most 3 cuts in the gold bar&lt;br /&gt;b)Mr. Jack can take back the gold bars , given to Mr. Jill, on any&lt;br /&gt;given day.&lt;br /&gt;&lt;br /&gt;Ans:&lt;/span&gt; Make 3 cuts at 1,2 and 4 cms&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;7)A car runs for 10,000 kms. It has one stepney(i.e, extra tyre).&lt;br /&gt;If all tyres has to be used equally, what is the total no. of&lt;br /&gt;kms, each tyre would have run?&lt;br /&gt;&lt;br /&gt;Ans:&lt;/span&gt; 8000 kms&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;8)There are 3 fruit baskets - one with full of Apples, one with&lt;br /&gt;full of Oranges and one with both apples and oranges. All boxes&lt;br /&gt;are labelled wrongly. You cannot see what is inside the box.&lt;br /&gt;Given these , you have to pick only one fruit from any one of the&lt;br /&gt;box of your choice, and label the boxes correctly. How do you&lt;br /&gt;solve this?&lt;br /&gt;&lt;br /&gt;Ans:&lt;/span&gt;&lt;br /&gt;----&lt;br /&gt;Pick one fruit from Box labelled "Mixed"&lt;br /&gt;If it is Apple then&lt;br /&gt;&lt;br /&gt;  Rename "Mixed" as "Apple".&lt;br /&gt;  Rename "Apple" as "Orange"&lt;br /&gt;  Rename "Orange" as "Mixed"&lt;br /&gt;&lt;br /&gt;else If it is Orange then&lt;br /&gt;&lt;br /&gt;  Rename "Mixed" as "Orange".&lt;br /&gt;  Rename "Orange" as "Apple"&lt;br /&gt;  Rename "Apple" as "Mixed"&lt;br /&gt;&lt;br /&gt;End if&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;9)From a List of String , how to get array of Strings&lt;br /&gt;Note: You only have to fill up the blanks in the following code.&lt;br /&gt;&lt;br /&gt;  private static void display()&lt;br /&gt;  {&lt;br /&gt;    List l = new ArrayList();&lt;br /&gt;    &lt;br /&gt;    l.add("tom");&lt;br /&gt;    l.add("harry");&lt;br /&gt;    String [] arr = ------------------;&lt;br /&gt;    &lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;Ans:&lt;/span&gt; (String [])l.toArray(new String[0])&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;10)What is the output of the following method&lt;br /&gt;&lt;br /&gt;  private static void display()&lt;br /&gt;  {&lt;br /&gt;    char x = 'X';&lt;br /&gt;    int i = 0;&lt;br /&gt;    System.out.print(true  ? x : 0);&lt;br /&gt;    System.out.print(false ? i : x);&lt;br /&gt;    &lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;Ans:&lt;/span&gt; X88&lt;br /&gt;&lt;br /&gt;Hope you found this useful! Kindly give me your comments regarding the same.Many more Quizzes are yet to be posted! Kindly make use of them as much as possible!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-607749608831175390?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/607749608831175390/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=607749608831175390&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/607749608831175390'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/607749608831175390'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/08/java-quiz-8.html' title='Java Quiz -8'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-7236763535116001815</id><published>2009-08-20T15:05:00.003+05:30</published><updated>2009-08-20T15:15:05.651+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>JUnit Tests</title><content type='html'>Hi Friends,&lt;br /&gt;Today Lets see A sample program as to how JUnit test is performed.&lt;br /&gt;For readers who can grasp information if explained using a program, this post is going to be very Informative.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;First We Have A Class for which JUnit has to be written&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;// JUnit test example&lt;br /&gt;&lt;br /&gt;public class Rectangle &lt;br /&gt;{&lt;br /&gt; // State variables.&lt;br /&gt; private int height;&lt;br /&gt; private int width;&lt;br /&gt; &lt;br /&gt; // Constructors&lt;br /&gt; Rectangle()&lt;br /&gt; {&lt;br /&gt;  height=0;&lt;br /&gt;  width =0;&lt;br /&gt; }&lt;br /&gt; Rectangle(int h,int w)&lt;br /&gt; {&lt;br /&gt;  height=h;&lt;br /&gt;  width =w;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; // Readers&lt;br /&gt; public int getH()&lt;br /&gt;  {return height;}&lt;br /&gt; public int getW()&lt;br /&gt;  {return width;}&lt;br /&gt; public int getA()&lt;br /&gt;  {return height* width;}&lt;br /&gt; &lt;br /&gt; // Writers&lt;br /&gt; public void setH(int h)&lt;br /&gt;  {height=h;}&lt;br /&gt; public void setW(int w)&lt;br /&gt;  {width =w;}&lt;br /&gt;&lt;br /&gt; public String toString()&lt;br /&gt;  {return "Rectangle: height="+height+"; width="+ width +&lt;br /&gt;  "; area="+getA()+".";}&lt;br /&gt;&lt;br /&gt;}  // End of Rectangle class&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Now We Create A TestCase for The Rectangle Class&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;       &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_YDxv9l_TcKc/So0ZwKgznTI/AAAAAAAAAAM/6DhIv3vgNhs/s1600-h/post.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 261px; height: 320px;" src="http://3.bp.blogspot.com/_YDxv9l_TcKc/So0ZwKgznTI/AAAAAAAAAAM/6DhIv3vgNhs/s320/post.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5371978245769239858" /&gt;&lt;/a&gt;        &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                &lt;br /&gt;import static org.junit.Assert.*;&lt;br /&gt;import org.junit.*;&lt;br /&gt;&lt;br /&gt;public class RectangleTest extends TestCase&lt;br /&gt;{&lt;br /&gt; Rectangle r;&lt;br /&gt; Rectangle[] rList=new Rectangle[5];&lt;br /&gt;&lt;br /&gt; @Before&lt;br /&gt; // Will be performed before each test.&lt;br /&gt; public void testSetup()&lt;br /&gt; {&lt;br /&gt;  System.out.println("Setup for test complete.");&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; @After&lt;br /&gt; // Will be performed after each test.&lt;br /&gt; public void testComplete()&lt;br /&gt; {&lt;br /&gt;  System.out.println("Test complete.");&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; @Test&lt;br /&gt; public void test1()&lt;br /&gt; {&lt;br /&gt;  // Can be run when reader methods and default &lt;br /&gt;  // constructor are complete.&lt;br /&gt;  r=new Rectangle();&lt;br /&gt;  try&lt;br /&gt;  {&lt;br /&gt;   assertTrue("Test 1: Default values are wrong.", &lt;br /&gt;    r.getH()==0 &amp;&amp; r.getW()==0);&lt;br /&gt;   System.out.println("Test 1 completed successfully.");&lt;br /&gt;  }&lt;br /&gt;  catch (AssertionError e)&lt;br /&gt;  {&lt;br /&gt;   System.out.println(e.getMessage());&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; @Test&lt;br /&gt; public void test2()&lt;br /&gt; {&lt;br /&gt;  // After area reader is written.&lt;br /&gt;  r=new Rectangle();&lt;br /&gt;  try&lt;br /&gt;  {&lt;br /&gt;   assertTrue("Test 2: Default values are wrong.", &lt;br /&gt;    r.getH()==0 &amp;&amp; r.getW()==0 &amp;&amp; r.getA()==0);&lt;br /&gt;   System.out.println("Test 2 completed successfully.");&lt;br /&gt;  }&lt;br /&gt;  catch (AssertionError e)&lt;br /&gt;  {&lt;br /&gt;   System.out.println(e.getMessage());&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt; @Test&lt;br /&gt; public void test3()&lt;br /&gt; {&lt;br /&gt;  // After second constructor is written.&lt;br /&gt;  r=new Rectangle();&lt;br /&gt;  try&lt;br /&gt;  {&lt;br /&gt;   r=new Rectangle(10,20);&lt;br /&gt;   assertTrue("Test 3: Initial values are wrong.", &lt;br /&gt;    r.getH()==10 &amp;&amp; r.getW()==20 &amp;&amp; r.getA()==200);&lt;br /&gt;   System.out.println("Test 3 completed successfully.");&lt;br /&gt;  }&lt;br /&gt;  catch (AssertionError e)&lt;br /&gt;  {&lt;br /&gt;   System.out.println(e.getMessage());&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; @Test&lt;br /&gt; public void test4()&lt;br /&gt; {&lt;br /&gt;  // After second constructor is written.&lt;br /&gt;  r=new Rectangle();&lt;br /&gt;  try&lt;br /&gt;  {&lt;br /&gt;   for (int i=0;i&lt;5;i++)&lt;br /&gt;   {&lt;br /&gt;    rList[i] = new Rectangle(2*i,3*i);&lt;br /&gt;    assertTrue("Test 4: Initial values are wrong.", &lt;br /&gt;     rList[i].getH()==2*i &amp;&amp; &lt;br /&gt;     rList[i].getW()==3*i &amp;&amp; &lt;br /&gt;     rList[i].getA()==6*i*i);&lt;br /&gt;   }&lt;br /&gt;   System.out.println("Test 4 completed successfully.");&lt;br /&gt;  }&lt;br /&gt;  catch (AssertionError e)&lt;br /&gt;  {&lt;br /&gt;   System.out.println(e.getMessage());&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; @Test&lt;br /&gt; public void test5()&lt;br /&gt; {&lt;br /&gt;  // After writers are written.&lt;br /&gt;  r=new Rectangle();&lt;br /&gt;  try&lt;br /&gt;  {&lt;br /&gt;   for (int i=0;i&lt;5;i++)&lt;br /&gt;   {&lt;br /&gt;    rList[i] = new Rectangle(2*i,3*i);&lt;br /&gt;    rList[i].setH(11*i);&lt;br /&gt;    rList[i].setW(7*i);&lt;br /&gt;    assertTrue("Test 5: Modified values are wrong.", &lt;br /&gt;     rList[i].getH()==11*i &amp;&amp; &lt;br /&gt;     rList[i].getW()==7*i &amp;&amp; &lt;br /&gt;     rList[i].getA()==77*i*i);&lt;br /&gt;   }&lt;br /&gt;   System.out.println("Test 5 completed successfully.");&lt;br /&gt;  }&lt;br /&gt;  catch (AssertionError e)&lt;br /&gt;  {&lt;br /&gt;   System.out.println(e.getMessage());&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; @Test&lt;br /&gt; public void test6()&lt;br /&gt; {&lt;br /&gt;  // toString test.&lt;br /&gt;  r=new Rectangle();&lt;br /&gt;  try&lt;br /&gt;  {&lt;br /&gt;   for (int i=0;i&lt;5;i++)&lt;br /&gt;   {&lt;br /&gt;    rList[i] = new Rectangle(2*i,3*i);&lt;br /&gt;    rList[i].setH(11*i);&lt;br /&gt;    rList[i].setW(7*i);&lt;br /&gt;    assertTrue("Test 6: Modified values are wrong.", &lt;br /&gt;     rList[i].getH()==11*i &amp;&amp; &lt;br /&gt;     rList[i].getW()==7*i &amp;&amp;&lt;br /&gt;     rList[i].getA()==77*i*i);&lt;br /&gt;    System.out.println(rList[i]);&lt;br /&gt;   }&lt;br /&gt;   System.out.println("Test 6 completed successfully.");&lt;br /&gt;  }&lt;br /&gt;  catch (AssertionError e)&lt;br /&gt;  {&lt;br /&gt;   System.out.println(e.getMessage());&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public static void main(String[] args) &lt;br /&gt; {&lt;br /&gt;  org.junit.runner.JUnitCore.main("RectangleTest");&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Output from correct Rectangle class test:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Setup for test complete.&lt;br /&gt;Test 1 completed successfully.&lt;br /&gt;Test complete.&lt;br /&gt;Setup for test complete.&lt;br /&gt;Test 2 completed successfully.&lt;br /&gt;Test complete.&lt;br /&gt;Setup for test complete.&lt;br /&gt;Test 3 completed successfully.&lt;br /&gt;Test complete.&lt;br /&gt;Setup for test complete.&lt;br /&gt;Test 4 completed successfully.&lt;br /&gt;Test complete.&lt;br /&gt;Setup for test complete.&lt;br /&gt;Test 5 completed successfully.&lt;br /&gt;Test complete.&lt;br /&gt;Setup for test complete.&lt;br /&gt;Rectangle: height=0; width=0; area=0.&lt;br /&gt;Rectangle: height=11; width=7; area=77.&lt;br /&gt;Rectangle: height=22; width=14; area=308.&lt;br /&gt;Rectangle: height=33; width=21; area=693.&lt;br /&gt;Rectangle: height=44; width=28; area=1232.&lt;br /&gt;Test 6 completed successfully.&lt;br /&gt;Test complete.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;I changed setH() so that height was set to h*2 and reran the tests.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Setup for test complete.&lt;br /&gt;Test 1 completed successfully.&lt;br /&gt;Test complete.&lt;br /&gt;Setup for test complete.&lt;br /&gt;Test 2 completed successfully.&lt;br /&gt;Test complete.&lt;br /&gt;Setup for test complete.&lt;br /&gt;Test 3 completed successfully.&lt;br /&gt;Test complete.&lt;br /&gt;Setup for test complete.&lt;br /&gt;Test 4 completed successfully.&lt;br /&gt;Test complete.&lt;br /&gt;Setup for test complete.&lt;br /&gt;Test 5: Modified values are wrong.&lt;br /&gt;Test complete.&lt;br /&gt;Setup for test complete.&lt;br /&gt;Rectangle: height=0; width=0; area=0.&lt;br /&gt;Test 6: Modified values are wrong.&lt;br /&gt;Test complete.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-7236763535116001815?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/7236763535116001815/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=7236763535116001815&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/7236763535116001815'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/7236763535116001815'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/08/junit-tests.html' title='JUnit Tests'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_YDxv9l_TcKc/So0ZwKgznTI/AAAAAAAAAAM/6DhIv3vgNhs/s72-c/post.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-1267537362523919608</id><published>2009-08-19T17:29:00.002+05:30</published><updated>2009-08-19T17:38:01.591+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Quiz'/><title type='text'>Java Quiz -7</title><content type='html'>Hi friends, &lt;br /&gt;&lt;br /&gt;Today I would like to post few more questions to test your capability. &lt;br /&gt;Dont worry guys, I will give you the answer too! Try to answer it yourself without referring to the answers to test yourself.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 1Given:&lt;br /&gt;1. public class Boxer1{&lt;br /&gt;2. Integer i;&lt;br /&gt;3. int x;&lt;br /&gt;4. public Boxer1(int y) {&lt;br /&gt;5. x = i+y;&lt;br /&gt;6. System.out.println(x);&lt;br /&gt;7. }&lt;br /&gt;8. public static void main(String[] args) {&lt;br /&gt;9. new Boxer1(new Integer(4));&lt;br /&gt;10. }&lt;br /&gt;11. }&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. The value "4" is printed at the command line.&lt;br /&gt;B. Compilation fails because of an error in line 5.&lt;br /&gt;C. Compilation fails because of an error in line 9.&lt;br /&gt;D. A NullPointerException occurs at runtime.&lt;br /&gt;E. A NumberFormatException occurs at runtime.&lt;br /&gt;F. An IllegalStateException occurs at runtime.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: D&lt;br /&gt;&lt;br /&gt;Q: 2 Given:&lt;br /&gt;11. public static Iterator reverse(List list) {&lt;br /&gt;12. Collections.reverse(list);&lt;br /&gt;13. return list.iterator();&lt;br /&gt;14. }&lt;br /&gt;15. public static void main(String[] args) {&lt;br /&gt;16. List list = new ArrayList();&lt;br /&gt;17. list.add("1"); list.add("2"); list.add("3");&lt;br /&gt;18. for (Object obj: reverse(list))&lt;br /&gt;19. System.out.print(obj + ", ");&lt;br /&gt;20. }&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. 3, 2, 1,&lt;br /&gt;B. 1, 2, 3,&lt;br /&gt;C. Compilation fails.&lt;br /&gt;D. The code runs with no output.&lt;br /&gt;E. An exception is thrown at runtime.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: C&lt;br /&gt;&lt;br /&gt;Q: 3 Click the Exhibit button.&lt;br /&gt;Given:&lt;br /&gt;25. try {&lt;br /&gt;26. A a = new A();&lt;br /&gt;27. a.method1();&lt;br /&gt;28. } catch (Exception e) {&lt;br /&gt;29. System.out.print("an error occurred");&lt;br /&gt;30. }&lt;br /&gt;Which two statements are true if a NullPointerException is thrown on line 3 of class C? (Choose two.)&lt;/span&gt;&lt;br /&gt;A. The application will crash.&lt;br /&gt;B. The code on line 29 will be executed.&lt;br /&gt;C. The code on line 5 of class A will execute.&lt;br /&gt;D. The code on line 5 of class B will execute.&lt;br /&gt;E. The exception will be propagated back to line 27.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: B, E&lt;br /&gt;&lt;br /&gt;Q: 4 Given:&lt;br /&gt;23. int z = 5;&lt;br /&gt;24.&lt;br /&gt;25. public void stuff1(int x) {&lt;br /&gt;26. assert (x &gt; 0);&lt;br /&gt;27. switch(x) {&lt;br /&gt;28. case 2: x = 3;&lt;br /&gt;29. default: assert false; } }&lt;br /&gt;30.&lt;br /&gt;31. private void stuff2(int y) { assert (y &lt; 0); }&lt;br /&gt;32.&lt;br /&gt;33. private void stuff3() { assert (stuff4()); }&lt;br /&gt;34.&lt;br /&gt;35. private boolean stuff4() { z = 6; return false; }&lt;br /&gt;Which statement is true?&lt;/span&gt;&lt;br /&gt;A. All of the assert statements are used appropriately.&lt;br /&gt;B. Only the assert statement on line 31 is used appropriately.&lt;br /&gt;C. The assert statements on lines 29 and 31 are used appropriately.&lt;br /&gt;D. The assert statements on lines 26 and 29 are used appropriately.&lt;br /&gt;E. The assert statements on lines 29 and 33 are used appropriately.&lt;br /&gt;F. The assert statements on lines 29, 31, and 33 are used appropriately.&lt;br /&gt;G. The assert statements on lines 26, 29, and 31 are used appropriately.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: C&lt;br /&gt;&lt;br /&gt;Q: 5 Given:&lt;br /&gt;25. int x = 12;&lt;br /&gt;26. while (x &lt; 10) {&lt;br /&gt;27. x--;&lt;br /&gt;28. }&lt;br /&gt;29. System.out.print(x);&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. 0&lt;br /&gt;B. 10&lt;br /&gt;C. 12&lt;br /&gt;D. Line 29 will never be reached.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: C&lt;br /&gt;&lt;br /&gt;Q: 6 Given:&lt;br /&gt;33. try {&lt;br /&gt;34. // some code here&lt;br /&gt;35. } catch (NullPointerException e1) {&lt;br /&gt;36. System.out.print("a");&lt;br /&gt;37. } catch (RuntimeException e2) {&lt;br /&gt;38. System.out.print("b");&lt;br /&gt;39. } finally {&lt;br /&gt;40. System.out.print("c");&lt;br /&gt;41. }&lt;br /&gt;What is the result if a NullPointerException occurs on line 34?&lt;/span&gt;&lt;br /&gt;A. c&lt;br /&gt;B. a&lt;br /&gt;C. ab&lt;br /&gt;D. ac&lt;br /&gt;E. bc&lt;br /&gt;F. abc&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: D&lt;br /&gt;&lt;br /&gt;Q: 7 Given:&lt;br /&gt;10. public class Foo {&lt;br /&gt;11. static int[] a;&lt;br /&gt;12. static { a[0]=2; }&lt;br /&gt;13. public static void main( String[] args ) {}&lt;br /&gt;14. }&lt;br /&gt;Which exception or error will be thrown when a programmer attempts to run this code?&lt;/span&gt;&lt;br /&gt;A. java.lang.StackOverflowError&lt;br /&gt;B. java.lang.IllegalStateException&lt;br /&gt;C. java.lang.ExceptionInInitializerError&lt;br /&gt;D. java.lang.ArrayIndexOutOfBoundsException&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: C&lt;br /&gt;&lt;br /&gt;Q: 8 Given:&lt;br /&gt;11. public static void main(String[] args) {&lt;br /&gt;12. try {&lt;br /&gt;13. args = null;&lt;br /&gt;14. args[0] = "test";&lt;br /&gt;15. System.out.println(args[0]);&lt;br /&gt;16. } catch (Exception ex) {&lt;br /&gt;17. System.out.println("Exception");&lt;br /&gt;18. } catch (NullPointerException npe) {&lt;br /&gt;19. System.out.println("NullPointerException");&lt;br /&gt;20. }&lt;br /&gt;21. }&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. test&lt;br /&gt;B. Exception&lt;br /&gt;C. Compilation fails.&lt;br /&gt;D. NullPointerException&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: C&lt;br /&gt;&lt;br /&gt;Q: 9 Given:&lt;br /&gt;12. public class Wow {&lt;br /&gt;13. public static void go(short n) {System.out.println("short");}&lt;br /&gt;14. public static void go(Short n) {System.out.println("SHORT");}&lt;br /&gt;15. public static void go(Long n) {System.out.println(" LONG");}&lt;br /&gt;16. public static void main(String [] args) {&lt;br /&gt;17. Short y = 6;&lt;br /&gt;18. int z = 7;&lt;br /&gt;19. go(y);&lt;br /&gt;20. go(z);&lt;br /&gt;21. }&lt;br /&gt;22. }&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. short LONG&lt;br /&gt;B. SHORT LONG&lt;br /&gt;C. Compilation fails.&lt;br /&gt;D. An exception is thrown at runtime.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: C&lt;br /&gt;&lt;br /&gt;Q: 10 Given:&lt;br /&gt;12. import java.io.*;&lt;br /&gt;13. public class Forest implements Serializable {&lt;br /&gt;14. private Tree tree = new Tree();&lt;br /&gt;15. public static void main(String [] args) {&lt;br /&gt;16. Forest f = new Forest();&lt;br /&gt;17. try {&lt;br /&gt;18. FileOutputStream fs = new FileOutputStream("Forest.ser");&lt;br /&gt;19. ObjectOutputStream os = new ObjectOutputStream(fs);&lt;br /&gt;20. os.writeObject(f); os.close();&lt;br /&gt;21. } catch (Exception ex) { ex.printStackTrace(); }&lt;br /&gt;22. } }&lt;br /&gt;23.&lt;br /&gt;24. class Tree { }&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. Compilation fails.&lt;br /&gt;B. An exception is thrown at runtime.&lt;br /&gt;C. An instance of Forest is serialized.&lt;br /&gt;D. An instance of Forest and an instance of Tree are both serialized.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: B&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Hope you found this useful! Kindly give me your comments regarding the same.Many more Quizzes are yet to be posted! Kindly make use of them as much as possible!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-1267537362523919608?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/1267537362523919608/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=1267537362523919608&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/1267537362523919608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/1267537362523919608'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/08/java-quiz-7.html' title='Java Quiz -7'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-3547007913111177081</id><published>2009-08-18T09:18:00.005+05:30</published><updated>2009-08-18T09:27:01.559+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Quiz'/><title type='text'>Java Quiz -6</title><content type='html'>Hi friends, &lt;br /&gt;&lt;br /&gt;Today I would like to post few more questions to test your capability. &lt;br /&gt;Dont worry guys, I will give you the answer too! Try to answer it yourself without referring to the answers to test yourself.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 1 Given:&lt;br /&gt;1. public class GC {&lt;br /&gt;2. private Object o;&lt;br /&gt;3. private void doSomethingElse(Object obj) { o = obj; }&lt;br /&gt;4. public void doSomething() {&lt;br /&gt;5. Object o = new Object();&lt;br /&gt;6. doSomethingElse(o);&lt;br /&gt;7. o = new Object();&lt;br /&gt;8. doSomethingElse(null);&lt;br /&gt;9. o = null;&lt;br /&gt;10. }&lt;br /&gt;11. }&lt;br /&gt;When the doSomething method is called, after which line does the Object created in line 5 become&lt;br /&gt;available for garbage collection?&lt;/span&gt;&lt;br /&gt;A. Line 5&lt;br /&gt;B. Line 6&lt;br /&gt;C. Line 7&lt;br /&gt;D. Line 8&lt;br /&gt;E. Line 9&lt;br /&gt;F. Line 10&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: D&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 2 Click the Exhibit button.&lt;br /&gt;Which three code fragments, added individually at line 29, produce the output 100? (Choose three.)&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;A. n = 100;&lt;br /&gt;B. i.setX( 100 );&lt;br /&gt;C. o.getY().setX( 100 );&lt;br /&gt;D. i = new Inner(); i.setX( 100 );&lt;br /&gt;E. o.setY( i ); i = new Inner(); i.setX( 100 );&lt;br /&gt;F. i = new Inner(); i.setX( 100 ); o.setY( i );&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: B, C, F&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 3 Given:&lt;br /&gt;15. public class Yippee {&lt;br /&gt;16. public static void main(String [] args) {&lt;br /&gt;17. for(int x = 1; x &lt; args.length; x++) {&lt;br /&gt;18. System.out.print(args[x] + " ");&lt;br /&gt;19. }&lt;br /&gt;20. }&lt;br /&gt;21. } and two separate command line invocations:&lt;br /&gt;java Yippee&lt;br /&gt;java Yippee 1 2 3 4&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. No output is produced.&lt;br /&gt;   1 2 3&lt;br /&gt;B. No output is produced.&lt;br /&gt;   2 3 4&lt;br /&gt;C. No output is produced.&lt;br /&gt;   1 2 3 4&lt;br /&gt;D. An exception is thrown at runtime.&lt;br /&gt;   1 2 3&lt;br /&gt;E. An exception is thrown at runtime.&lt;br /&gt;   2 3 4&lt;br /&gt;F. An exception is thrown at runtime.&lt;br /&gt;   1 2 3 4&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: B&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 4 Given:&lt;br /&gt;11. public void genNumbers() {&lt;br /&gt;12. ArrayList numbers = new ArrayList();&lt;br /&gt;13. for (int i=0; i&lt;10; i++) {&lt;br /&gt;14. int value = i * ((int) Math.random());&lt;br /&gt;15. Integer intObj = new Integer(value);&lt;br /&gt;16. numbers.add(intObj);&lt;br /&gt;17. }&lt;br /&gt;18. System.out.println(numbers);&lt;br /&gt;19. }&lt;br /&gt;Which line of code marks the earliest point that an object referenced by intObj becomes a candidate for&lt;br /&gt;garbage collection?&lt;/span&gt;&lt;br /&gt;A. Line 16&lt;br /&gt;B. Line 17&lt;br /&gt;C. Line 18&lt;br /&gt;D. Line 19&lt;br /&gt;E. The object is NOT a candidate for garbage collection.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: D&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 5 Click the Exhibit button.&lt;br /&gt;Given the fully-qualified class names:&lt;br /&gt;com.foo.bar.Dog&lt;br /&gt;com.foo.bar.blatz.Book&lt;br /&gt;com.bar.Car&lt;br /&gt;com.bar.blatz.Sun&lt;br /&gt;Which graph represents the correct directory structure for a JAR file from which those classes can be&lt;br /&gt;used by the compiler and JVM?&lt;/span&gt;&lt;br /&gt;A. Jar A&lt;br /&gt;B. Jar B&lt;br /&gt;C. Jar C&lt;br /&gt;D. Jar D&lt;br /&gt;E. Jar E&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: A&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 6 A class games.cards.Poker is correctly defined in the jar file Poker.jar. A user&lt;br /&gt;wants to execute the main method of Poker on a UNIX system using the command:&lt;br /&gt;java games.cards.Poker&lt;br /&gt;What allows the user to do this?&lt;/span&gt;&lt;br /&gt;A. put Poker.jar in directory /stuff/java, and set the CLASSPATH to include /stuff/java&lt;br /&gt;B. put Poker.jar in directory /stuff/java, and set the CLASSPATH to include /stuff/java/*.jar&lt;br /&gt;C. Put Poker.jar in directory /stuff/java, and set the CLASSPATH to include /stuff/java/Poker.jar&lt;br /&gt;D. put Poker.jar in directory /stuff/java/games/cards, and set the CLASSPATH to include /stuff/java&lt;br /&gt;E. put Poker.jar in directory /stuff/java/games/cards, and set the CLASSPATH to include /stuff/java/*.jar&lt;br /&gt;F. put Poker.jar in directory /stuff/java/games/cards, and set the CLASSPATH to include /stuff/java/Poker.jar&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: C&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 7 Given a class Repetition:&lt;br /&gt;1. package utils;&lt;br /&gt;2.&lt;br /&gt;3. public class Repetition {&lt;br /&gt;4. public static String twice(String s) { return s + s; }&lt;br /&gt;5. }&lt;br /&gt;and given another class Demo:&lt;br /&gt;1. // insert code here&lt;br /&gt;2.&lt;br /&gt;3. public class Demo {&lt;br /&gt;4. public static void main(String[] args) {&lt;br /&gt;5. System.out.println(twice("pizza"));&lt;br /&gt;6. }&lt;br /&gt;7. }&lt;br /&gt;Which code should be inserted at line 1 of Demo.java to compile and run Demo to print "pizzapizza"?&lt;/span&gt;&lt;br /&gt;A. import utils.*;&lt;br /&gt;B. static import utils.*;&lt;br /&gt;C. import utils.Repetition.*;&lt;br /&gt;D. static import utils.Repetition.*;&lt;br /&gt;E. import utils.Repetition.twice();&lt;br /&gt;F. import static utils.Repetition.twice;&lt;br /&gt;G. static import utils.Repetition.twice;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: F&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 8 Given:&lt;br /&gt;11. public static void main(String[] args) {&lt;br /&gt;12. String str = "null";&lt;br /&gt;13. if (str == null) {&lt;br /&gt;14. System.out.println("null");&lt;br /&gt;15. } else (str.length() == 0) {&lt;br /&gt;16. System.out.println("zero");&lt;br /&gt;17. } else {&lt;br /&gt;18. System.out.println("some");&lt;br /&gt;19. }&lt;br /&gt;20. }&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. null&lt;br /&gt;B. zero&lt;br /&gt;C. some&lt;br /&gt;D. Compilation fails.&lt;br /&gt;E. An exception is thrown at runtime.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: D&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 9 Given:&lt;br /&gt;11. static class A {&lt;br /&gt;12. void process() throws Exception { throw new Exception(); }&lt;br /&gt;13. }&lt;br /&gt;14. static class B extends A {&lt;br /&gt;15. void process() { System.out.println("B "); }&lt;br /&gt;16. }&lt;br /&gt;17. public static void main(String[] args) {&lt;br /&gt;18. A a = new B();&lt;br /&gt;19. a.process();&lt;br /&gt;20. }&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. B&lt;br /&gt;B. The code runs with no output.&lt;br /&gt;C. An exception is thrown at runtime.&lt;br /&gt;D. Compilation fails because of an error in line 15.&lt;br /&gt;E. Compilation fails because of an error in line 18.&lt;br /&gt;F. Compilation fails because of an error in line 19.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: F&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 10 Given:&lt;br /&gt;11. public void testIfA() {&lt;br /&gt;12. if (testIfB("True")) {&lt;br /&gt;13. System.out.println("True");&lt;br /&gt;14. } else {&lt;br /&gt;15. System.out.println("Not true");&lt;br /&gt;16. }&lt;br /&gt;17. }&lt;br /&gt;18. public Boolean testIfB(String str) {&lt;br /&gt;19. return Boolean.valueOf(str);&lt;br /&gt;20. }&lt;br /&gt;What is the result when method testIfA is invoked?&lt;/span&gt;&lt;br /&gt;A. True&lt;br /&gt;B. Not true&lt;br /&gt;C. An exception is thrown at runtime.&lt;br /&gt;D. Compilation fails because of an error at line 12.&lt;br /&gt;E. Compilation fails because of an error at line 19.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: A&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Hope you found this useful! Kindly give me your comments regarding the same.Many more Quizzes are yet to be posted! Kindly make use of them as much as possible!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-3547007913111177081?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/3547007913111177081/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=3547007913111177081&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/3547007913111177081'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/3547007913111177081'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/08/java-quiz-6.html' title='Java Quiz -6'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-650142790554131130</id><published>2009-08-17T09:12:00.004+05:30</published><updated>2009-08-17T09:23:04.087+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Quiz'/><title type='text'>Java Quiz -5</title><content type='html'>Hi friends, &lt;br /&gt;&lt;br /&gt;Today I would like to post few more questions to test your capability. &lt;br /&gt;Dont worry guys, I will give you the answer too! Try to answer it yourself without referring to the answers to test yourself.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 1 Given:&lt;br /&gt;10: public class Hello {&lt;br /&gt;11: String title;&lt;br /&gt;12: int value;&lt;br /&gt;13: public Hello() {&lt;br /&gt;14: title += " World";&lt;br /&gt;15: }&lt;br /&gt;16: public Hello(int value) {&lt;br /&gt;17: this.value = value;&lt;br /&gt;18: title = "Hello";&lt;br /&gt;19: Hello();&lt;br /&gt;20: }&lt;br /&gt;21: }&lt;br /&gt;and:&lt;br /&gt;30: Hello c = new Hello(5);&lt;br /&gt;31: System.out.println(c.title);&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. Hello&lt;br /&gt;B. Hello World&lt;br /&gt;C. Compilation fails.&lt;br /&gt;D. Hello World 5&lt;br /&gt;E. The code runs with no output.&lt;br /&gt;F. An exception is thrown at runtime.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: C&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 2 Given:&lt;br /&gt;1. class Super {&lt;br /&gt;2. private int a;&lt;br /&gt;3. protected Super(int a) { this.a = a; }&lt;br /&gt;4. }&lt;br /&gt;...&lt;br /&gt;11. class Sub extends Super {&lt;br /&gt;12. public Sub(int a) { super(a); }&lt;br /&gt;13. public Sub() { this.a = 5; }&lt;br /&gt;14. }&lt;br /&gt;Which two, independently, will allow Sub to compile? (Choose two.)&lt;/span&gt;&lt;br /&gt;A. Change line 2 to:&lt;br /&gt;   public int a;&lt;br /&gt;B. Change line 2 to:&lt;br /&gt;   protected int a;&lt;br /&gt;C. Change line 13 to:&lt;br /&gt;   public Sub() { this(5); }&lt;br /&gt;D. Change line 13 to:&lt;br /&gt;   public Sub() { super(5); }&lt;br /&gt;E. Change line 13 to:&lt;br /&gt;   public Sub() { super(a); }&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: C, D&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 3 Given:&lt;br /&gt;1. class ClassA {&lt;br /&gt;2. public int numberOfInstances;&lt;br /&gt;3. protected ClassA(int numberOfInstances) {&lt;br /&gt;4. this.numberOfInstances = numberOfInstances;&lt;br /&gt;5. }&lt;br /&gt;6. }&lt;br /&gt;7. public class ExtendedA extends ClassA {&lt;br /&gt;8. private ExtendedA(int numberOfInstances) {&lt;br /&gt;9. super(numberOfInstances);&lt;br /&gt;10. }&lt;br /&gt;11. public static void main(String[] args) {&lt;br /&gt;12. ExtendedA ext = new ExtendedA(420);&lt;br /&gt;13. System.out.print(ext.numberOfInstances);&lt;br /&gt;14. }&lt;br /&gt;15. }&lt;br /&gt;Which statement is true?&lt;/span&gt;&lt;br /&gt;A. 420 is the output.&lt;br /&gt;B. An exception is thrown at runtime.&lt;br /&gt;C. All constructors must be declared public.&lt;br /&gt;D. Constructors CANNOT use the private modifier.&lt;br /&gt;E. Constructors CANNOT use the protected modifier.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: A&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 4 Given:&lt;br /&gt;1. interface A { public void aMethod(); }&lt;br /&gt;2. interface B { public void bMethod(); }&lt;br /&gt;3. interface C extends A,B { public void cMethod(); }&lt;br /&gt;4. class D implements B {&lt;br /&gt;5. public void bMethod(){}&lt;br /&gt;6. }&lt;br /&gt;7. class E extends D implements C {&lt;br /&gt;8. public void aMethod(){}&lt;br /&gt;9. public void bMethod(){}&lt;br /&gt;10. public void cMethod(){}&lt;br /&gt;11. }&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. Compilation fails because of an error in line 3.&lt;br /&gt;B. Compilation fails because of an error in line 7.&lt;br /&gt;C. Compilation fails because of an error in line 9.&lt;br /&gt;D. If you define D e = new E(), then e.bMethod() invokes the version of bMethod() defined in Line 5.&lt;br /&gt;E. If you define D e = (D)(new E()), then e.bMethod() invokes the version of bMethod() defined in Line 5.&lt;br /&gt;F. If you define D e = (D)(new E()), then e.bMethod() invokes the version of bMethod() defined in Line 9.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: F&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 5 Given:&lt;br /&gt;1. public class Base {&lt;br /&gt;2. public static final String FOO = "foo";&lt;br /&gt;3. public static void main(String[] args) {&lt;br /&gt;4. Base b = new Base();&lt;br /&gt;5. Sub s = new Sub();&lt;br /&gt;6. System.out.print(Base.FOO);&lt;br /&gt;7. System.out.print(Sub.FOO);&lt;br /&gt;8. System.out.print(b.FOO);&lt;br /&gt;9. System.out.print(s.FOO);&lt;br /&gt;10. System.out.print(((Base)s).FOO);&lt;br /&gt;11. } }&lt;br /&gt;12. class Sub extends Base {public static final String FOO="bar";}&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. foofoofoofoofoo&lt;br /&gt;B. foobarfoobarbar&lt;br /&gt;C. foobarfoofoofoo&lt;br /&gt;D. foobarfoobarfoo&lt;br /&gt;E. barbarbarbarbar&lt;br /&gt;F. foofoofoobarbar&lt;br /&gt;G. foofoofoobarfoo&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: D&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 6 Which two statements are true? (Choose two.)&lt;/span&gt;&lt;br /&gt;A. An encapsulated, public class promotes re-use.&lt;br /&gt;B. Classes that share the same interface are always tightly encapsulated.&lt;br /&gt;C. An encapsulated class allows subclasses to overload methods, but does NOT allow overriding methods.&lt;br /&gt;D. An encapsulated class allows a programmer to change an implementation without affecting outside code.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: A, D&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 7 Given classes defined in two different files:&lt;br /&gt;1. package util;&lt;br /&gt;2. public class BitUtils {&lt;br /&gt;3. public static void process(byte[]) { /* more code here */ }&lt;br /&gt;4. }&lt;br /&gt;1. package app;&lt;br /&gt;2. public class SomeApp {&lt;br /&gt;3. public static void main(String[] args) {&lt;br /&gt;4. byte[] bytes = new byte[256];&lt;br /&gt;5. // insert code here&lt;br /&gt;6. }&lt;br /&gt;7. }&lt;br /&gt;What is required at line 5 in class SomeApp to use the process method of BitUtils?&lt;/span&gt;&lt;br /&gt;A. process(bytes);&lt;br /&gt;B. BitUtils.process(bytes);&lt;br /&gt;C. util.BitUtils.process(bytes);&lt;br /&gt;D. SomeApp cannot use methods in BitUtils.&lt;br /&gt;E. import util.BitUtils.*; process(bytes);&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: C&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 8 Given:&lt;br /&gt;13. public class Pass {&lt;br /&gt;14. public static void main(String [] args) {&lt;br /&gt;15. int x = 5;&lt;br /&gt;16. Pass p = new Pass();&lt;br /&gt;17. p.doStuff(x);&lt;br /&gt;18. System.out.print(" main x = " + x);&lt;br /&gt;19. }&lt;br /&gt;20.&lt;br /&gt;21. void doStuff(int x) {&lt;br /&gt;22. System.out.print(" doStuff x = " + x++);&lt;br /&gt;23. }&lt;br /&gt;24. }&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. Compilation fails.&lt;br /&gt;B. An exception is thrown at runtime.&lt;br /&gt;C. doStuff x = 6 main x = 6&lt;br /&gt;D. doStuff x = 5 main x = 5&lt;br /&gt;E. doStuff x = 5 main x = 6&lt;br /&gt;F. doStuff x = 6 main x = 5&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: D&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 9 Given:&lt;br /&gt;11. public static void test(String str) {&lt;br /&gt;12. if (str == null | str.length() == 0) {&lt;br /&gt;13. System.out.println("String is empty");&lt;br /&gt;14. } else {&lt;br /&gt;15. System.out.println("String is not empty");&lt;br /&gt;16. }&lt;br /&gt;17. }&lt;br /&gt;And the invocation:&lt;br /&gt;31. test(null);&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. An exception is thrown at runtime.&lt;br /&gt;B. "String is empty" is printed to output.&lt;br /&gt;C. Compilation fails because of an error in line 12.&lt;br /&gt;D. "String is not empty" is printed to output.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: A&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 10 Given:&lt;br /&gt;12. public class Yippee2 {&lt;br /&gt;13.&lt;br /&gt;14. static public void main(String [] yahoo) {&lt;br /&gt;15. for(int x = 1; x &lt; yahoo.length; x++) {&lt;br /&gt;16. System.out.print(yahoo[x] + " ");&lt;br /&gt;17. }&lt;br /&gt;18. }&lt;br /&gt;19. }&lt;br /&gt;and the command line invocation:&lt;br /&gt;java Yippee2 a b c&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. a b&lt;br /&gt;B. b c&lt;br /&gt;C. a b c&lt;br /&gt;D. Compilation fails.&lt;br /&gt;E. An exception is thrown at runtime.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: B&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Hope you found this useful! Kindly give me your comments regarding the same.Many more Quizzes are yet to be posted! Kindly make use of them as much as possible!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-650142790554131130?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/650142790554131130/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=650142790554131130&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/650142790554131130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/650142790554131130'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/08/java-quiz-5.html' title='Java Quiz -5'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-3081931666715889493</id><published>2009-08-15T16:19:00.007+05:30</published><updated>2009-08-15T16:28:52.820+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Quiz'/><title type='text'>Java Quiz -4</title><content type='html'>Hi friends, &lt;br /&gt;&lt;br /&gt;Today I would like to post few more questions to test your capability. &lt;br /&gt;Dont worry guys, I will give you the answer too! Try to answer it yourself without referring to the answers to test yourself.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 1 Click the Task button.&lt;br /&gt;Answer: Check TestNows eEngine, Download from Member Center&lt;br /&gt;www.TestNows.com Q: 43 Given:&lt;br /&gt;11. String test = "This is a test";&lt;br /&gt;12. String[] tokens = test.split("\s");&lt;br /&gt;13. System.out.println(tokens.length);&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. 0&lt;br /&gt;B. 1&lt;br /&gt;C. 4&lt;br /&gt;D. Compilation fails.&lt;br /&gt;E. An exception is thrown at runtime.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: D&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 2 Given:&lt;br /&gt;11. public class Yikes {&lt;br /&gt;12.&lt;br /&gt;13. public static void go(Long n) {System.out.println("Long ");}&lt;br /&gt;14. public static void go(Short n) {System.out.println("Short ");}&lt;br /&gt;15. public static void go(int n) {System.out.println("int ");}&lt;br /&gt;16. public static void main(String [] args) {&lt;br /&gt;17. short y = 6;&lt;br /&gt;18. long z = 7;&lt;br /&gt;19. go(y);&lt;br /&gt;20. go(z);&lt;br /&gt;21. }&lt;br /&gt;22. }&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. int Long&lt;br /&gt;B. Short Long&lt;br /&gt;C. Compilation fails.&lt;br /&gt;D. An exception is thrown at runtime.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: A&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 3 Given:&lt;br /&gt;System.out.format("Pi is approximately %d.", Math.PI);&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. Compilation fails.&lt;br /&gt;B. Pi is approximately 3.&lt;br /&gt;C. Pi is approximately 3.141593.&lt;br /&gt;D. An exception is thrown at runtime.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: D&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 4 Given:&lt;br /&gt;33. Date d = new Date(0);&lt;br /&gt;34. String ds = "December 15, 2004";&lt;br /&gt;35. // insert code here&lt;br /&gt;36. try {&lt;br /&gt;37. d = df.parse(ds);&lt;br /&gt;38. }&lt;br /&gt;39. catch(ParseException e) {&lt;br /&gt;40. System.out.println("Unable to parse " + ds);&lt;br /&gt;41. }&lt;br /&gt;42. // insert code here too&lt;br /&gt;What creates the appropriate DateFormat object and adds a day to the Date object?&lt;/span&gt;&lt;br /&gt;A. 35. DateFormat df = DateFormat.getDateFormat();&lt;br /&gt;   42. d.setTime( (60 * 60 * 24) + d.getTime());&lt;br /&gt;B. 35. DateFormat df = DateFormat.getDateInstance();&lt;br /&gt;   42. d.setTime( (1000 * 60 * 60 * 24) + d.getTime());&lt;br /&gt;C. 35. DateFormat df = DateFormat.getDateFormat();&lt;br /&gt;   42. d.setLocalTime( (1000*60*60*24) + d.getLocalTime());&lt;br /&gt;D. 35. DateFormat df = DateFormat.getDateInstance();&lt;br /&gt;   42. d.setLocalTime( (60 * 60 * 24) + d.getLocalTime());&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: B&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 5 Given:&lt;br /&gt;12. NumberFormat nf = NumberFormat.getInstance();&lt;br /&gt;13. nf.setMaximumFractionDigits(4);&lt;br /&gt;14. nf.setMinimumFractionDigits(2);&lt;br /&gt;15. String a = nf.format(3.1415926);&lt;br /&gt;16. String b = nf.format(2);&lt;br /&gt;Which two statements are true about the result if the default locale is Locale.US? (Choose two.)&lt;/span&gt;&lt;br /&gt;A. The value of b is 2.&lt;br /&gt;B. The value of a is 3.14.&lt;br /&gt;C. The value of b is 2.00.&lt;br /&gt;D. The value of a is 3.141.&lt;br /&gt;E. The value of a is 3.1415.&lt;br /&gt;F. The value of a is 3.1416.&lt;br /&gt;G. The value of b is 2.0000.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: C, F&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 6 Given:&lt;br /&gt;12. import java.io.*;&lt;br /&gt;13. public class Forest implements Serializable {&lt;br /&gt;14. private Tree tree = new Tree();&lt;br /&gt;15. public static void main(String [] args) {&lt;br /&gt;16. Forest f = new Forest();&lt;br /&gt;17. try {&lt;br /&gt;18. FileOutputStream fs = new FileOutputStream("Forest.ser");&lt;br /&gt;19. ObjectOutputStream os = new ObjectOutputStream(fs);&lt;br /&gt;20. os.writeObject(f); os.close();&lt;br /&gt;21. } catch (Exception ex) { ex.printStackTrace(); }&lt;br /&gt;22. } }&lt;br /&gt;23.&lt;br /&gt;24. class Tree { }&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. Compilation fails.&lt;br /&gt;B. An exception is thrown at runtime.&lt;br /&gt;C. An instance of Forest is serialized.&lt;br /&gt;D. An instance of Forest and an instance of Tree are both serialized.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: B&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 7 Assuming that the serializeBanana() and the deserializeBanana() methods will&lt;br /&gt;correctly use Java serialization and given:&lt;br /&gt;13. import java.io.*;&lt;br /&gt;14. class Food implements Serializable {int good = 3;}&lt;br /&gt;15. class Fruit extends Food {int juice = 5;}&lt;br /&gt;16. public class Banana extends Fruit {&lt;br /&gt;17. int yellow = 4;&lt;br /&gt;18. public static void main(String [] args) {&lt;br /&gt;19. Banana b = new Banana(); Banana b2 = new Banana();&lt;br /&gt;20. b.serializeBanana(b); // assume correct serialization&lt;br /&gt;21. b2 = b.deserializeBanana(); // assume correct&lt;br /&gt;22. System.out.println("restore "+b2.yellow+ b2.juice+b2.good);&lt;br /&gt;24. }&lt;br /&gt;25. // more Banana methods go here 50. }&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. restore 400&lt;br /&gt;B. restore 403&lt;br /&gt;C. restore 453&lt;br /&gt;D. Compilation fails.&lt;br /&gt;E. An exception is thrown at runtime.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: C&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 8 Given this method in a class:&lt;br /&gt;21. public String toString() {&lt;br /&gt;22. StringBuffer buffer = new StringBuffer();&lt;br /&gt;23. buffer.append('&lt;');&lt;br /&gt;24. buffer.append(this.name);&lt;br /&gt;25. buffer.append('&gt;');&lt;br /&gt;26. return buffer.toString();&lt;br /&gt;27. }&lt;br /&gt;Which statement is true?&lt;/span&gt;&lt;br /&gt;A. This code is NOT thread-safe.&lt;br /&gt;B. The programmer can replace StringBuffer with StringBuilder with no other changes.&lt;br /&gt;C. This code will perform poorly. For better performance, the code should be rewritten:&lt;br /&gt;return "&lt;" + this.name + "&gt;";&lt;br /&gt;D. This code will perform well and converting the code to use StringBuilder will not enhance the performance.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: B&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 9 Given:&lt;br /&gt;1. package geometry;&lt;br /&gt;2. public class Hypotenuse {&lt;br /&gt;3. public InnerTriangle it = new InnerTriangle();&lt;br /&gt;4. class InnerTriangle {&lt;br /&gt;5. public int base;&lt;br /&gt;6. public int height;&lt;br /&gt;7. }&lt;br /&gt;8. }&lt;br /&gt;Which statement is true about the class of an object that can reference the variable base?&lt;/span&gt;&lt;br /&gt;A. It can be any class.&lt;br /&gt;B. No class has access to base.&lt;br /&gt;C. The class must belong to the geometry package.&lt;br /&gt;D. The class must be a subclass of the class Hypotenuse.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: C&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 10 Which two statements are true about has-a and is-a relationships? (Choose&lt;br /&gt;two.)&lt;/span&gt;&lt;br /&gt;A. Inheritance represents an is-a relationship.&lt;br /&gt;B. Inheritance represents a has-a relationship.&lt;br /&gt;C. Interfaces must be used when creating a has-a relationship.&lt;br /&gt;D. Instance variables can be used when creating a has-a relationship.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: A, D&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Hope you found this useful! Kindly give me your comments regarding the same.Many more Quizzes are to be posted! Kindly make use of them as much as possible!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-3081931666715889493?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/3081931666715889493/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=3081931666715889493&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/3081931666715889493'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/3081931666715889493'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/08/java-quiz-4.html' title='Java Quiz -4'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-7513631234036936065</id><published>2009-08-14T09:59:00.003+05:30</published><updated>2009-08-14T10:06:20.652+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Quiz'/><title type='text'>Java Quiz -3</title><content type='html'>Hi friends, &lt;br /&gt;&lt;br /&gt;Today I would like to post few more questions to test your capability. &lt;br /&gt;Dont worry guys, I will give you the answer too! Try to answer it yourself without referring to the answers to test yourself.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 1 Given:&lt;br /&gt;11. public class Test {&lt;br /&gt;12. public enum Dogs {collie, harrier, shepherd};&lt;br /&gt;13. public static void main(String [] args) {&lt;br /&gt;14. Dogs myDog = Dogs.shepherd;&lt;br /&gt;15. switch (myDog) {&lt;br /&gt;16. case collie:&lt;br /&gt;17. System.out.print("collie ");&lt;br /&gt;18. case default:&lt;br /&gt;19. System.out.print("retriever ");&lt;br /&gt;20. case harrier:&lt;br /&gt;21. System.out.print("harrier ");&lt;br /&gt;22. }&lt;br /&gt;23. }&lt;br /&gt;24. }&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. harrier&lt;br /&gt;B. shepherd&lt;br /&gt;C. retriever&lt;br /&gt;D. Compilation fails.&lt;br /&gt;E. retriever harrier&lt;br /&gt;F. An exception is thrown at runtime.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: D&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 2 Given:&lt;br /&gt;8. public class test {&lt;br /&gt;9. public static void main(String [] a) {&lt;br /&gt;10. assert a.length == 1;&lt;br /&gt;11. }&lt;br /&gt;12. }&lt;br /&gt;Which two will produce an AssertionError? (Choose two.)&lt;/span&gt;&lt;br /&gt;A. java test&lt;br /&gt;B. java -ea test&lt;br /&gt;C. java test file1&lt;br /&gt;D. java -ea test file1&lt;br /&gt;E. java -ea test file1 file2&lt;br /&gt;F. java -ea:test test file1&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: B, E&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 3 Given:&lt;br /&gt;10. interface Foo {}&lt;br /&gt;11. class Alpha implements Foo {}&lt;br /&gt;12. class Beta extends Alpha {}&lt;br /&gt;13. class Delta extends Beta {&lt;br /&gt;14. public static void main( String[] args ) {&lt;br /&gt;15. Beta x = new Beta();&lt;br /&gt;16. // insert code here&lt;br /&gt;17. }&lt;br /&gt;18. }&lt;br /&gt;Which code, inserted at line 16, will cause a java.lang.ClassCastException?&lt;/span&gt;&lt;br /&gt;A. Alpha a = x;&lt;br /&gt;B. Foo f = (Delta)x;&lt;br /&gt;C. Foo f = (Alpha)x;&lt;br /&gt;D. Beta b = (Beta)(Alpha)x;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: B&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 4 Given:&lt;br /&gt;11. public static Collection get() {&lt;br /&gt;12. Collection sorted = new LinkedList();&lt;br /&gt;13. sorted.add("B"); sorted.add("C"); sorted.add("A");&lt;br /&gt;14. return sorted;&lt;br /&gt;15. }&lt;br /&gt;16. public static void main(String[] args) {&lt;br /&gt;17. for (Object obj: get()) {&lt;br /&gt;18. System.out.print(obj + ", ");&lt;br /&gt;19. }&lt;br /&gt;20. }&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. A, B, C,&lt;br /&gt;B. B, C, A,&lt;br /&gt;C. Compilation fails.&lt;br /&gt;D. The code runs with no output.&lt;br /&gt;E. An exception is thrown at runtime.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: B&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 5 Given:&lt;br /&gt;84. try {&lt;br /&gt;85. ResourceConnection con = resourceFactory.getConnection();&lt;br /&gt;86. Results r = con.query("GET INFO FROM CUSTOMER");&lt;br /&gt;87. info = r.getData();&lt;br /&gt;88. con.close();&lt;br /&gt;89. } catch (ResourceException re) {&lt;br /&gt;90. errorLog.write(re.getMessage());&lt;br /&gt;91. }&lt;br /&gt;92. return info;&lt;br /&gt;Which statement is true if a ResourceException is thrown on line 86?&lt;/span&gt;&lt;br /&gt;A. Line 92 will not execute.&lt;br /&gt;B. The connection will not be retrieved in line 85.&lt;br /&gt;C. The resource connection will not be closed on line 88.&lt;br /&gt;D. The enclosing method will throw an exception to its caller.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: C&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 6 Given:&lt;br /&gt;31. // some code here&lt;br /&gt;32. try {&lt;br /&gt;33. // some code here&lt;br /&gt;34. } catch (SomeException se) {&lt;br /&gt;35. // some code here&lt;br /&gt;36. } finally {&lt;br /&gt;37. // some code here&lt;br /&gt;38. }&lt;br /&gt;Under which three circumstances will the code on line 37 be executed? (Choose Three.)&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;A. The instance gets garbage collected.&lt;br /&gt;B. The code on line 33 throws an exception.&lt;br /&gt;C. The code on line 35 throws an exception.&lt;br /&gt;D. The code on line 31 throws an exception.&lt;br /&gt;E. The code on line 33 executes successfully.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: B, C, E&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 7 Given:&lt;br /&gt;11. class A {&lt;br /&gt;12. public void process() { System.out.print("A,"); }&lt;br /&gt;13. class B extends A {&lt;br /&gt;14. public void process() throws IOException {&lt;br /&gt;15. super.process();&lt;br /&gt;16. System.out.print("B,");&lt;br /&gt;17. throw new IOException();&lt;br /&gt;18. }&lt;br /&gt;19. public static void main(String[] args) {&lt;br /&gt;20. try { new B().process(); }&lt;br /&gt;21. catch (IOException e) { System.out.println("Exception"); }}&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. Exception&lt;br /&gt;B. A,B,Exception&lt;br /&gt;C. Compilation fails because of an error in line 20.&lt;br /&gt;D. Compilation fails because of an error in line 14.&lt;br /&gt;E. A NullPointerException is thrown at runtime.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: D&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 8 Given a method that must ensure that its parameter is not null:&lt;br /&gt;11. public void someMethod(Object value) {&lt;br /&gt;12. // check for null value&lt;br /&gt;...&lt;br /&gt;20. System.out.println(value.getClass());&lt;br /&gt;21. }&lt;br /&gt;What, inserted at line 12, is the appropriate way to handle a null value?&lt;/span&gt;&lt;br /&gt;A. assert value == null;&lt;br /&gt;B. assert value != null, "value is null";&lt;br /&gt;C. if (value == null) {&lt;br /&gt;throw new AssertionException("value is null");&lt;br /&gt;}&lt;br /&gt;D. if (value == null) {&lt;br /&gt;throw new IllegalArgumentException("value is null");&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: D&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 9 Given:&lt;br /&gt;11. static void test() throws Error {&lt;br /&gt;12. if (true) throw new AssertionError();&lt;br /&gt;13. System.out.print("test ");&lt;br /&gt;14. }&lt;br /&gt;15. public static void main(String[] args) {&lt;br /&gt;16. try { test(); }&lt;br /&gt;17. catch (Exception ex) { System.out.print("exception "); }&lt;br /&gt;18. System.out.print("end ");&lt;br /&gt;19. }&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. end&lt;br /&gt;B. Compilation fails.&lt;br /&gt;C. exception end&lt;br /&gt;D. exception test end&lt;br /&gt;E. A Throwable is thrown by main.&lt;br /&gt;F. An Exception is thrown by main.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: E&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 10 Given:&lt;br /&gt;11. Float pi = new Float(3.14f);&lt;br /&gt;12. if (pi &gt; 3) {&lt;br /&gt;13. System.out.print("pi is bigger than 3. ");&lt;br /&gt;14. }&lt;br /&gt;15. else {&lt;br /&gt;16. System.out.print("pi is not bigger than 3. ");&lt;br /&gt;17. }&lt;br /&gt;18. finally {&lt;br /&gt;19. System.out.println("Have a nice day.");&lt;br /&gt;20. }&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. Compilation fails.&lt;br /&gt;B. pi is bigger than 3.&lt;br /&gt;C. An exception occurs at runtime.&lt;br /&gt;D. pi is bigger than 3. Have a nice day.&lt;br /&gt;E. pi is not bigger than 3. Have a nice day.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: A&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Hope you found this useful! Kindly give me your comments regarding the same.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-7513631234036936065?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/7513631234036936065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=7513631234036936065&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/7513631234036936065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/7513631234036936065'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/08/java-quiz-3.html' title='Java Quiz -3'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-5336734190598829146</id><published>2009-08-13T09:18:00.006+05:30</published><updated>2009-08-13T09:26:35.586+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Quiz'/><title type='text'>Java Quiz -2</title><content type='html'>Hi friends, &lt;br /&gt;&lt;br /&gt;Today I would like to post few more questions to test your capability. &lt;br /&gt;Dont worry guys, I will give you the answer too! Try to answer it yourself without referring to the answers to test yourself.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 1 Given:&lt;br /&gt;10. public class Bar {&lt;br /&gt;11. static void foo( int... x ) {&lt;br /&gt;12. // insert code here&lt;br /&gt;13. }&lt;br /&gt;14. }&lt;br /&gt;Which two code fragments, inserted independently at line 12, will allow the class to compile? (Choose&lt;br /&gt;two.)&lt;/span&gt;&lt;br /&gt;A. foreach( x ) System.out.println(z);&lt;br /&gt;B. for( int z : x ) System.out.println(z);&lt;br /&gt;C. while( x.hasNext() ) System.out.println( x.next() );&lt;br /&gt;D. for( int i=0; i&lt; x.length; i++ ) System.out.println(x[i]);&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: B, D&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 2 Given:&lt;br /&gt;1. public class Plant {&lt;br /&gt;2. private String name;&lt;br /&gt;3. public Plant(String name) { this.name = name; }&lt;br /&gt;4. public String getName() { return name; }&lt;br /&gt;5. }&lt;br /&gt;1. public class Tree extends Plant {&lt;br /&gt;2. public void growFruit() { }&lt;br /&gt;3. public void dropLeaves() { }&lt;br /&gt;4. }&lt;br /&gt;Which statement is true?&lt;br /&gt;&lt;/span&gt;A. The code will compile without changes.&lt;br /&gt;B. The code will compile if public Tree() { Plant(); } is added to the Tree class.&lt;br /&gt;C. The code will compile if public Plant() { Tree(); } is added to the Plant class.&lt;br /&gt;D. The code will compile if public Plant() { this("fern"); } is added to the Plant class.&lt;br /&gt;E. The code will compile if public Plant() { Plant("fern"); } is added to the Plant class.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: D&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 3 Which two classes correctly implement both the java.lang.Runnable and the&lt;br /&gt;java.lang.Clonable interfaces? (Choose two.)&lt;/span&gt;&lt;br /&gt;A. public class Session&lt;br /&gt;implements Runnable, Clonable {&lt;br /&gt;public void run();&lt;br /&gt;public Object clone();&lt;br /&gt;}&lt;br /&gt;B. public class Session&lt;br /&gt;extends Runnable, Clonable {&lt;br /&gt;public void run() { /* do something */ }&lt;br /&gt;&lt;br /&gt;public Object clone() { /* make a copy */ }&lt;br /&gt;C. public class Session&lt;br /&gt;implements Runnable, Clonable {&lt;br /&gt;public void run() { /* do something */ }&lt;br /&gt;public Object clone() { /* make a copy */ }&lt;br /&gt;D. public abstract class Session&lt;br /&gt;implements Runnable, Clonable {&lt;br /&gt;public void run() { /* do something */ }&lt;br /&gt;public Object clone() { /*make a copy */ }&lt;br /&gt;E. public class Session&lt;br /&gt;implements Runnable, implements Clonable {&lt;br /&gt;public void run() { /* do something */ }&lt;br /&gt;public Object clone() { /* make a copy */ }&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: C, D&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 4 Given:&lt;br /&gt;1. public class Threads2 implements Runnable {&lt;br /&gt;2.&lt;br /&gt;3. public void run() {&lt;br /&gt;4. System.out.println("run.");&lt;br /&gt;5. throw new RuntimeException("Problem");&lt;br /&gt;6. }&lt;br /&gt;7. public static void main(String[] args) {&lt;br /&gt;8. Thread t = new Thread(new Threads2());&lt;br /&gt;9. t.start();&lt;br /&gt;10. System.out.println("End of method.");&lt;br /&gt;11. }&lt;br /&gt;12. }&lt;br /&gt;Which two can be results? (Choose two.)&lt;/span&gt;&lt;br /&gt;A. java.lang.RuntimeException: Problem&lt;br /&gt;B. run.&lt;br /&gt;java.lang.RuntimeException: Problem&lt;br /&gt;C. End of method.&lt;br /&gt;java.lang.RuntimeException: Problem&lt;br /&gt;D. End of method.&lt;br /&gt;run.&lt;br /&gt;java.lang.RuntimeException: Problem&lt;br /&gt;E. run.&lt;br /&gt;java.lang.RuntimeException: Problem&lt;br /&gt;End of method.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: D, E&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 5 Given:&lt;br /&gt;1. public class TestSeven extends Thread {&lt;br /&gt;2. private static int x;&lt;br /&gt;3. public synchronized void doThings() {&lt;br /&gt;4. int current = x;&lt;br /&gt;5. current++;&lt;br /&gt;6. x = current;&lt;br /&gt;7. }&lt;br /&gt;8. public void run() {&lt;br /&gt;9. doThings();&lt;br /&gt;10. }&lt;br /&gt;11.}&lt;br /&gt;Which statement is true?&lt;/span&gt;&lt;br /&gt;A. Compilation fails.&lt;br /&gt;B. An exception is thrown at runtime.&lt;br /&gt;C. Synchronizing the run() method would make the class thread-safe.&lt;br /&gt;D. The data in variable "x" are protected from concurrent access problems.&lt;br /&gt;E. Declaring the doThings() method as static would make the class thread-safe.&lt;br /&gt;F. Wrapping the statements within doThings() in a synchronized(new Object()) { } block would make the class thread-safe.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: E&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 6 Given:&lt;br /&gt;1. public class Threads3 implements Runnable {&lt;br /&gt;2. public void run() {&lt;br /&gt;3. System.out.print("running");&lt;br /&gt;4. }&lt;br /&gt;5. public static void main(String[] args) {&lt;br /&gt;6. Thread t = new Thread(new Threads3());&lt;br /&gt;7. t.run();&lt;br /&gt;8. t.run();&lt;br /&gt;9. t.start();&lt;br /&gt;10. }&lt;br /&gt;11. }&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. Compilation fails.&lt;br /&gt;B. An exception is thrown at runtime.&lt;br /&gt;C. The code executes and prints "running".&lt;br /&gt;D. The code executes and prints "runningrunning".&lt;br /&gt;E. The code executes and prints "runningrunningrunning".&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: E&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 7 Given:&lt;br /&gt;public class NamedCounter {&lt;br /&gt;private final String name;&lt;br /&gt;private int count;&lt;br /&gt;public NamedCounter(String name) { this.name = name; }&lt;br /&gt;public String getName() { return name; }&lt;br /&gt;public void increment() { count++; }&lt;br /&gt;public int getCount() { return count; }&lt;br /&gt;public void reset() { count = 0; }&lt;br /&gt;}&lt;br /&gt;Which three changes should be made to adapt this class to be used safely by multiple threads? (Choose&lt;br /&gt;three.)&lt;/span&gt;&lt;br /&gt;A. declare reset() using the synchronized keyword&lt;br /&gt;B. declare getName() using the synchronized keyword&lt;br /&gt;C. declare getCount() using the synchronized keyword&lt;br /&gt;D. declare the constructor using the synchronized keyword&lt;br /&gt;E. declare increment() using the synchronized keyword&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: A, C, E&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 8 Given:&lt;br /&gt;7. void waitForSignal() {&lt;br /&gt;8. Object obj = new Object();&lt;br /&gt;9. synchronized (Thread.currentThread()) {&lt;br /&gt;10. obj.wait();&lt;br /&gt;11. obj.notify();&lt;br /&gt;12. }&lt;br /&gt;13. }&lt;br /&gt;Which statement is true?&lt;/span&gt;&lt;br /&gt;A. This code may throw an InterruptedException.&lt;br /&gt;B. This code may throw an IllegalStateException.&lt;br /&gt;C. This code may throw a TimeoutException after ten minutes.&lt;br /&gt;D. This code will not compile unless "obj.wait()" is replaced with "((Thread) obj).wait()".&lt;br /&gt;E. Reversing the order of obj.wait() and obj.notify() may cause this method to complete normally.&lt;br /&gt;F. A call to notify() or notifyAll() from another thread may cause this method to complete normally.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: B&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 9 Which two code fragments will execute the method doStuff() in a separate&lt;br /&gt;thread? (Choose two.)&lt;/span&gt;&lt;br /&gt;A. new Thread() {&lt;br /&gt;public void run() { doStuff(); }&lt;br /&gt;};&lt;br /&gt;B. new Thread() {&lt;br /&gt;public void start() { doStuff(); }&lt;br /&gt;};&lt;br /&gt;C. new Thread() {&lt;br /&gt;public void start() { doStuff(); }&lt;br /&gt;}.run();&lt;br /&gt;D. new Thread() {&lt;br /&gt;public void run() { doStuff(); }&lt;br /&gt;}.start();&lt;br /&gt;E. new Thread(new Runnable() {&lt;br /&gt;public void run() { doStuff(); }&lt;br /&gt;}).run();&lt;br /&gt;F. new Thread(new Runnable() {&lt;br /&gt;public void run() { doStuff(); }&lt;br /&gt;}).start();&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: D, F&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 10 Given:&lt;br /&gt;1. public class TestOne implements Runnable {&lt;br /&gt;2. public static void main (String[] args) throws Exception {&lt;br /&gt;3. Thread t = new Thread(new TestOne());&lt;br /&gt;4. t.start();&lt;br /&gt;5. System.out.print("Started");&lt;br /&gt;6. t.join();&lt;br /&gt;7. System.out.print("Complete");&lt;br /&gt;8. }&lt;br /&gt;9. public void run() {&lt;br /&gt;10. for (int i = 0; i &lt; 4; i++) {&lt;br /&gt;11. System.out.print(i);&lt;br /&gt;12. }&lt;br /&gt;13. }&lt;br /&gt;14. }&lt;br /&gt;What can be a result?&lt;/span&gt;&lt;br /&gt;A. Compilation fails.&lt;br /&gt;B. An exception is thrown at runtime.&lt;br /&gt;C. The code executes and prints "StartedComplete".&lt;br /&gt;D. The code executes and prints "StartedComplete0123".&lt;br /&gt;E. The code executes and prints "Started0123Complete".&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: E&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Hope you found this useful! Kindly give me your comments regarding the same.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-5336734190598829146?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/5336734190598829146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=5336734190598829146&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/5336734190598829146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/5336734190598829146'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/08/java-quiz-2.html' title='Java Quiz -2'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-3776201862456224675</id><published>2009-08-12T09:13:00.004+05:30</published><updated>2009-08-12T09:26:43.115+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Quiz'/><title type='text'>Java Quiz -1</title><content type='html'>Hi friends,&lt;br /&gt;&lt;br /&gt;Today I would like to post some questions for you to test your capability.&lt;br /&gt;Dont worry guys, I will give you the answer too! Try to answer it yourself without referring to the answers.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q 1:&lt;br /&gt;Given:&lt;br /&gt;11. public class Person {&lt;br /&gt;12. private String name, comment;&lt;br /&gt;13. private int age;&lt;br /&gt;14. public Person(String n, int a, String c) {&lt;br /&gt;15. name = n; age = a; comment = c;&lt;br /&gt;16. }&lt;br /&gt;17. public boolean equals(Object o) {&lt;br /&gt;18. if (! (o instanceof Person)) return false;&lt;br /&gt;19, Person p = (Person)o;&lt;br /&gt;20. return age == p.age &amp;&amp; name.equals(p.name);&lt;br /&gt;21. }&lt;br /&gt;22. }&lt;br /&gt;What is the appropriate definition of the hashCode method in class Person?&lt;/span&gt;&lt;br /&gt;A. return super.hashCode();&lt;br /&gt;B. return name.hashCode() + age * 7;&lt;br /&gt;C. return name.hashCode() + comment.hashCode() / 2;&lt;br /&gt;D. return name.hashCode() + comment.hashCode() / 2 - age * 3;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: B&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 2 Given:&lt;br /&gt;34. HashMap props = new HashMap();&lt;br /&gt;35. props.put("key45", "some value");&lt;br /&gt;36. props.put("key12", "some other value");&lt;br /&gt;37. props.put("key39", "yet another value");&lt;br /&gt;38. Set s = props.keySet();&lt;br /&gt;39. // insert code here&lt;br /&gt;What, inserted at line 39, will sort the keys in the props HashMap?&lt;/span&gt;&lt;br /&gt;A. Arrays.sort(s);&lt;br /&gt;B. s = new TreeSet(s);&lt;br /&gt;C. Collections.sort(s);&lt;br /&gt;D. s = new SortedSet(s);&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: B&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 3 Given:&lt;br /&gt;23. Object [] myObjects = {&lt;br /&gt;24. new Integer(12),&lt;br /&gt;25. new String("foo"),&lt;br /&gt;26. new Integer(5),&lt;br /&gt;27. new Boolean(true)&lt;br /&gt;28. };&lt;br /&gt;29. Arrays.sort(myObjects);&lt;br /&gt;30. for(int i=0; i&lt;myObjects.length; i++) {&lt;br /&gt;31. System.out.print(myObjects[i].toString());&lt;br /&gt;32. System.out.print(" ");&lt;br /&gt;33. }&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. Compilation fails due to an error in line 23.&lt;br /&gt;B. Compilation fails due to an error in line 29.&lt;br /&gt;C. A ClassCastException occurs in line 29.&lt;br /&gt;D. A ClassCastException occurs in line 31.&lt;br /&gt;E. The value of all four objects prints in natural order.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: C&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 4 Given:&lt;br /&gt;1. public class Person {&lt;br /&gt;2. private String name;&lt;br /&gt;3. public Person(String name) { this.name = name; }&lt;br /&gt;4. public boolean equals(Person p) {&lt;br /&gt;5. return p.name.equals(this.name);&lt;br /&gt;6. }&lt;br /&gt;7. }&lt;br /&gt;Which statement is true?&lt;/span&gt;&lt;br /&gt;A. The equals method does NOT properly override the Object.equals method.&lt;br /&gt;B. Compilation fails because the private attribute p.name cannot be accessed in line 5.&lt;br /&gt;C. To work correctly with hash-based data structures, this class must also implement the hashCode method.&lt;br /&gt;D. When adding Person objects to a java.util.Set collection, the equals method in line 4 will prevent duplicates.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: A&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 5 Given:&lt;br /&gt;1. import java.util.*;&lt;br /&gt;2. public class Old {&lt;br /&gt;3. public static Object get0(List list) {&lt;br /&gt;4. return list.get(0);&lt;br /&gt;5. }&lt;br /&gt;6. }&lt;br /&gt;Which three will compile successfully? (Choose three.)&lt;/span&gt;&lt;br /&gt;A. Object o = Old.get0(new LinkedList());&lt;br /&gt;B. Object o = Old.get0(new LinkedList&lt;?&gt;());&lt;br /&gt;C. String s = Old.get0(new LinkedList&lt;String&gt;());&lt;br /&gt;D. Object o = Old.get0(new LinkedList&lt;Object&gt;());&lt;br /&gt;E. String s = (String)Old.get0(new LinkedList&lt;String&gt;());&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: A, D, E&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 6 Given:&lt;br /&gt;1. import java.util.*;&lt;br /&gt;2. public class Example {&lt;br /&gt;3. public static void main(String[] args) {&lt;br /&gt;4. // insert code here&lt;br /&gt;5. set.add(new Integer(2));&lt;br /&gt;6. set.add(new Integer(1));&lt;br /&gt;7. System.out.println(set);&lt;br /&gt;8. }&lt;br /&gt;9. }&lt;br /&gt;Which code, inserted at line 4, guarantees that this program will output [1, 2]?&lt;/span&gt;&lt;br /&gt;A. Set set = new TreeSet();&lt;br /&gt;B. Set set = new HashSet();&lt;br /&gt;C. Set set = new SortedSet();&lt;br /&gt;D. List set = new SortedList();&lt;br /&gt;E. Set set = new LinkedHashSet();&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: A&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 7 Given&lt;br /&gt;10. class Foo {&lt;br /&gt;11. static void alpha() { /* more code here */ }&lt;br /&gt;12. void beta() { /* more code here */ }&lt;br /&gt;13. }&lt;br /&gt;Which two statements are true? (Choose two.)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A. Foo.beta() is a valid invocation of beta().&lt;br /&gt;B. Foo.alpha() is a valid invocation of alpha().&lt;br /&gt;C. Method beta() can directly call method alpha().&lt;br /&gt;D. Method alpha() can directly call method beta().&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: B, C&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 8 Given:&lt;br /&gt;11. public static void parse(String str) {&lt;br /&gt;12. try {&lt;br /&gt;13. float f = Float.parseFloat(str);&lt;br /&gt;14. } catch (NumberFormatException nfe) {&lt;br /&gt;15. f = 0;&lt;br /&gt;16. } finally {&lt;br /&gt;17. System.out.println(f);&lt;br /&gt;18. }&lt;br /&gt;19. }&lt;br /&gt;20. public static void main(String[] args) {&lt;br /&gt;21. parse("invalid");&lt;br /&gt;22. }&lt;br /&gt;What is the result?&lt;/span&gt;&lt;br /&gt;A. 0.0&lt;br /&gt;B. Compilation fails.&lt;br /&gt;C. A ParseException is thrown by the parse method at runtime.&lt;br /&gt;D. A NumberFormatException is thrown by the parse method at runtime.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: B&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 9 Given:&lt;br /&gt;10. class Line {&lt;br /&gt;11. public static class Point {}&lt;br /&gt;12. }&lt;br /&gt;13.&lt;br /&gt;14. class Triangle {&lt;br /&gt;15. // insert code here&lt;br /&gt;16. }&lt;br /&gt;Which code, inserted at line 15, creates an instance of the Point class defined in Line?&lt;/span&gt;&lt;br /&gt;A. Point p = new Point();&lt;br /&gt;B. Line.Point p = new Line.Point();&lt;br /&gt;C. The Point class cannot be instatiated at line 15.&lt;br /&gt;D. Line l = new Line() ; l.Point p = new l.Point();&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: B&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Q: 10 Given:&lt;br /&gt;10. package com.sun.scjp;&lt;br /&gt;11. public class Geodetics {&lt;br /&gt;12. public static final double DIAMETER = 12756.32; // kilometers&lt;br /&gt;13. }&lt;br /&gt;Which two correctly access the DIAMETER member of the Geodetics class? (Choose two.)&lt;/span&gt;&lt;br /&gt;A. import com.sun.scjp.Geodetics;&lt;br /&gt;public class TerraCarta {&lt;br /&gt;public double halfway()&lt;br /&gt;{ return Geodetics.DIAMETER/2.0; }&lt;br /&gt;B. import static com.sun.scjp.Geodetics;&lt;br /&gt;public class TerraCarta{&lt;br /&gt;public double halfway() { return DIAMETER/2.0; } }&lt;br /&gt;C. import static com.sun.scjp.Geodetics.*;&lt;br /&gt;public class TerraCarta {&lt;br /&gt;public double halfway() { return DIAMETER/2.0; } }&lt;br /&gt;D. package com.sun.scjp;&lt;br /&gt;public class TerraCarta {&lt;br /&gt;public double halfway() { return DIAMETER/2.0; } }&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer: A, C&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So friends,&lt;br /&gt;I am going to come out with more and more challenging questions.&lt;br /&gt;Hope you find it useful, Your comments are welcome!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-3776201862456224675?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/3776201862456224675/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=3776201862456224675&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/3776201862456224675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/3776201862456224675'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/08/java-quiz-1.html' title='Java Quiz -1'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-4435845347133359753</id><published>2009-08-10T09:08:00.009+05:30</published><updated>2009-08-10T09:41:02.977+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Command Pattern In Java</title><content type='html'>Hi Friends,&lt;br /&gt;&lt;br /&gt;Today I would like to show a program for command patterns.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Client.java&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;/**&lt;br /&gt; * Creates a ConcreteCommand object and specifies its receiver.&lt;br /&gt; */&lt;/span&gt;&lt;br /&gt;public class Client&lt;br /&gt;{&lt;br /&gt; public Command setup()&lt;br /&gt; {&lt;br /&gt;  Command command = new ConcreteCommand();&lt;br /&gt;  Receiver receiver = new ConcreteReceiver();&lt;br /&gt;  command.setReceiver( receiver );&lt;br /&gt;&lt;br /&gt;  // We return the command so that the Invoker may use it.&lt;br /&gt;&lt;br /&gt;  return command;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Command.java&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * Declares an interface for executing an operation.&lt;br /&gt; */&lt;/span&gt;&lt;br /&gt;public interface Command&lt;br /&gt;{&lt;br /&gt; void setReceiver( Receiver receiver );&lt;br /&gt; Receiver getReceiver();&lt;br /&gt; void execute();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;ConcreteCommand.java&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * Defines a binding between a Receiver object and an&lt;br /&gt; * action. Implements Execute by invoking the corresponding&lt;br /&gt; * operation on Receiver.&lt;br /&gt; */&lt;/span&gt;&lt;br /&gt;public class ConcreteCommand implements Command&lt;br /&gt;{&lt;br /&gt; private Receiver receiver;&lt;br /&gt;&lt;br /&gt; public void setReceiver( Receiver receiver )&lt;br /&gt; {&lt;br /&gt;  this.receiver = receiver;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public Receiver getReceiver()&lt;br /&gt; {&lt;br /&gt;  return receiver;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public void execute()&lt;br /&gt; {&lt;br /&gt;  receiver.action();&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;ConcreteReceiver&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * Implementation of the Receiver interface.&lt;br /&gt; */&lt;/span&gt;&lt;br /&gt;public class ConcreteReceiver implements Receiver&lt;br /&gt;{&lt;br /&gt; public void action()&lt;br /&gt; {&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Receiver.java&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * Knows how to perform the operations associated with&lt;br /&gt; * carrying out a request. Any class may serve as a Receiver.&lt;br /&gt; */&lt;/span&gt;&lt;br /&gt;public interface Receiver&lt;br /&gt;{&lt;br /&gt; void action();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Test.java&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * Test driver for the pattern.&lt;br /&gt; */&lt;/span&gt;&lt;br /&gt;public class Test&lt;br /&gt;{&lt;br /&gt; public static void main( String arg[] )&lt;br /&gt; {&lt;br /&gt;  try&lt;br /&gt;  {&lt;br /&gt;   Client client = new Client();&lt;br /&gt;   Command command = client.setup();&lt;br /&gt;   command.execute();&lt;br /&gt;  }&lt;br /&gt;  catch( Exception e )&lt;br /&gt;  {&lt;br /&gt;   e.printStackTrace();&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;So friends, Hope you found it useful. Please give your valuable feedback.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-4435845347133359753?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/4435845347133359753/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=4435845347133359753&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/4435845347133359753'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/4435845347133359753'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/08/command-pattern-in-java.html' title='Command Pattern In Java'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-13615721067846335</id><published>2009-08-07T09:03:00.005+05:30</published><updated>2009-08-10T09:39:45.427+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Assertions in Java</title><content type='html'>Hi friends,&lt;br /&gt;&lt;br /&gt;The advent of J2SE 1.4 saw the introduction of few important changes to augment the power of java. Predominant among them are the java logging API, Chained exceptions, Assertions and so on. In this article we shall explore the concept of assertions and how they can add to the flexibility of the java language. &lt;br /&gt;Assertions though a new concept introduced in the J2SE 1.4 specifications have been a well established practice in the programming community from the ages of the Eiffel programming language. Assertions, as stated above are not a new concept introduced by java; they have been around for a number of years in many object oriented programming languages. Assertions and exceptions derive themselves from the concept of "Design by Contract," which is followed in most of the object oriented languages. The design by contract theory states that an application is created or designed according to a contract or specification agreed upon by the creator and the consumer about the functioning of the application. Vendors and implementers have been asking for assertions to be included as a part of the specification. A good number of them have their private implementations of assertions. &lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;What are assertions?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To quote the text from the JSR 41 (Java Specification Request) &lt;br /&gt;"An assertion is a statement containing a boolean expression that the programmer believes to be true at the time the statement is executed". In other words this means a facility provided within the java programming language to test the correctness or assumptions made by your program. The assumptions could be simple facts like a number cannot be negative or the range of a number is between 3.3 and 5.67. Assertions are checks provided within the system to ensure the smooth running of the program.&lt;br /&gt; &lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Why Assertions:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The next obvious question that comes up is why we need another level of checking when exceptions can do the job. Java exceptions are primarily used to handle unusual conditions arising during program execution. Assertions are used to specify conditions that a programmer assumes are true. When programming, if a programmer can swear that the value being passed into a particular method is positive no matter what a calling client passes, it can be documented using an assertion to state it. Exceptions handle abnormal conditions arising in the course of the program; however they do not guarantee smooth or correct execution of the program. Assertions help state scenarios that ensure the program is running smoothly. Assertions can be efficient tools to ensure correct execution of a program. They improve the confidence about the program. &lt;br /&gt;How to use Assertions:&lt;br /&gt;The assertion statement has two forms.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;assertExpression1;&lt;br /&gt;assert Expression1:Expression2;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The first one is a simpler form that takes a boolean expression as an argument. The expression is the one the programmer wishes to assert as true. If the assumption fails, the expression evaluates to be false which means the assertion failed. In case the expression succeeds the program continues normally. &lt;br /&gt;The second form is the more descriptive one. The first argument takes a Boolean expression, while the second expression would be the resulting action to be taken if the assertion fails. The Expression2 should be a value and can also be a result of executing a function. The compiler would throw an error if the second expression returns a void value. &lt;br /&gt;As discussed before an assertion is not a replacement for an exception and cannot be used to show user level errors. User level errors need to be passed to an appropriate error handler and they need be presented to the user more gracefully. Assertions, like exceptions, throw an exception which would show them as part of the stack trace. &lt;br /&gt;When an assertion fails the program would throw an AssertionError on to the stack trace. If the simpler form of assertion is used the program would create an object of AssertionError with the default constructor, while in the second form an object of AssertionError with the return type of Expression2. The overloaded AssertionError constructor would then convert the returned data type into String and dump it on the stack trace with a meaningful message. A few examples are shown below.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;assert i&lt;0;&lt;br /&gt;assert (!myString.equals(""));&lt;br /&gt;assert age&gt;0 : "The value of age cannot be negative +"age;    &lt;br /&gt;assert ((i/2*23-12)&gt;0):checkArgumentValue();        &lt;br /&gt;assert isParameterValid():throwIllegalParameterError();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In the last example the method checkArgumentValue() must return a value. &lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Where to use Assertions:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As we stated earlier, assertions are not to replace exceptions but to augment them. Assertions should not be used at any place to ensure the smooth running of a program. The fact that assertions can be turned off could make your programs behave erratically. &lt;br /&gt;&lt;br /&gt;So friends, Hope this information was usefull to you. PLease give your valuable feedback.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-13615721067846335?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/13615721067846335/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=13615721067846335&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/13615721067846335'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/13615721067846335'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/08/assertions-in-java.html' title='Assertions in Java'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-3324107943752799847</id><published>2009-08-05T09:36:00.007+05:30</published><updated>2009-08-10T09:38:42.953+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Example of Singleton</title><content type='html'>Hi friends,&lt;br /&gt;&lt;br /&gt;Today I would write a note on an another example of singleton pattern as follows&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Logic:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  Defines an Instance operation that lets clients access&lt;br /&gt;  its unique instance. Instance is a class operation&lt;br /&gt;  (that is, a class method in Smalltalk and a static member&lt;br /&gt;  function is C++). May be responsible for creating its own&lt;br /&gt;  instance.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Code:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;public class Singleton&lt;br /&gt;{&lt;br /&gt; private static Singleton instance = null;&lt;br /&gt; public static Singleton getSingleton()&lt;br /&gt; {&lt;br /&gt;  if( instance == null )&lt;br /&gt;  {&lt;br /&gt;   instance = new Singleton();&lt;br /&gt;  }&lt;br /&gt;  return instance;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class Test&lt;br /&gt;{&lt;br /&gt; public static void main( String arg[] )&lt;br /&gt; {&lt;br /&gt;  try&lt;br /&gt;  {&lt;br /&gt;   Singleton instance = Singleton.getSingleton();&lt;br /&gt;  }&lt;br /&gt;  catch( Exception e )&lt;br /&gt;  {&lt;br /&gt;   e.printStackTrace();&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Hope this was useful to you. Please give me your valuable suggestions.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-3324107943752799847?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/3324107943752799847/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=3324107943752799847&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/3324107943752799847'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/3324107943752799847'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/08/example-of-singleton.html' title='Example of Singleton'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-7958498337809486990</id><published>2009-08-03T10:10:00.015+05:30</published><updated>2009-08-10T09:38:52.295+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Basic Example Of Singleton</title><content type='html'>Hi friends,&lt;br /&gt;Today I would like to give out an another program for singleton pattern.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Logic:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Only one object can be created. Here suppose if another object is created I have assigned its reference to point to the Object already created.&lt;br /&gt;So, here only one object would be created, but if even if another user tries to create another object then his reference would be same.You will understand this is more detail with the following example.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Code:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;public class SingletonSampleGood {&lt;br /&gt; static int flag = 0;&lt;br /&gt; private static SingletonSampleGood chandraSample = null;&lt;br /&gt; private String name;&lt;br /&gt;&lt;br /&gt; private SingletonSampleGood() {&lt;br /&gt;  if (flag != 0) {&lt;br /&gt;   System.out.println("Singleton from chandra");&lt;br /&gt;&lt;br /&gt;  } else {&lt;br /&gt;&lt;br /&gt;   getInstance();&lt;br /&gt;   System.out.println("Flag Error");&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public static SingletonSampleGood getInstance() {&lt;br /&gt;  if (chandraSample == null) {&lt;br /&gt;   flag = 1;&lt;br /&gt;&lt;br /&gt;   chandraSample = new SingletonSampleGood();&lt;br /&gt;   flag = 0;&lt;br /&gt;  } else {&lt;br /&gt;   System.out.println("Error");&lt;br /&gt;&lt;br /&gt;   return chandraSample;&lt;br /&gt;  }&lt;br /&gt;  return chandraSample;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public static void main(String[] args) {&lt;br /&gt;   SingletonSampleGood sample1 = SingletonSampleGood.getInstance();&lt;br /&gt;   System.out.println("Reference1 =" + sample1); &lt;br /&gt;          SingletonSampleGood chandraSample1 = SingletonSampleGood.getInstance();&lt;br /&gt;   System.out.println("Reference2 =" + chandraSample1);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Output:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Singleton from chandra&lt;br /&gt;Reference1 =SingletonSampleGood@3e25a5&lt;br /&gt;Error&lt;br /&gt;Reference2 =SingletonSampleGood@3e25a5&lt;br /&gt;&lt;br /&gt;So friends,&lt;br /&gt;Hope you found my program useful in explaining the Singleton pattern concept. Hope it was useful to you.&lt;br /&gt;Please give your suggestions for further improvement.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-7958498337809486990?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/7958498337809486990/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=7958498337809486990&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/7958498337809486990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/7958498337809486990'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/08/basic-example-of-singleton.html' title='Basic Example Of Singleton'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-1473076256330223208</id><published>2009-07-31T17:31:00.012+05:30</published><updated>2009-08-10T09:42:18.854+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Core Java Basics</title><content type='html'>Hi friends,&lt;br /&gt;Today, I would like to note some points that freshers in JAVA should know.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;1.Abstract class&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; For an abstract class, we can't create an object,&lt;br /&gt; &lt;br /&gt; it's sole purpose is only to be extended.&lt;br /&gt; &lt;br /&gt; If a Class is marked abstract and if any class is extending this Class then we will have to implement this method in that class too, or it will throw an error.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;2.Final Keyword&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; Final Keyword is used before a class declaration and such a class cannot be extended.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;3.Interface&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; An Interface is otherwise known as a 100% abstract class, consisting of abstract methods only. Suppose if you create any other methods other than abstract methods, then it will throw an error&lt;br /&gt; &lt;br /&gt; Only an interface can extend another interface&lt;br /&gt; &lt;br /&gt; A class can implement a interface but cannot extend it&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;4.Static&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;We can use static keyword either in front of a Class or a method &lt;br /&gt;&lt;br /&gt;and suppose &lt;br /&gt;&lt;br /&gt;If we are calling this method in another class, we need not create an instance/object for that class,we can straight away call the method with the help of the class name itself.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;5.Method&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A method should always be contained inside a class&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;6.Object&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Objects are created with &lt;span style="font-weight:bold;"&gt;"new"&lt;/span&gt; keyword and are present in a memory known as heap.&lt;br /&gt;Their scope ends with the end of execution of the Class.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;7.Instance Variables&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Instance Variables are created inside methods and are present in a memory known as stack.&lt;br /&gt;Their scope ends with the end of execution of the method.&lt;br /&gt;&lt;br /&gt;This is not all! We have lots more to discuss! We shall learn slowly one step at a time!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-1473076256330223208?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/1473076256330223208/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=1473076256330223208&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/1473076256330223208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/1473076256330223208'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/07/hi-friends-today-i-would-like-to-note.html' title='Core Java Basics'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-7695417629270151708</id><published>2009-07-30T09:29:00.015+05:30</published><updated>2009-08-10T09:50:31.337+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Multiplicaton Table using Singleton Pattern</title><content type='html'>Hi friends,&lt;br /&gt;&lt;br /&gt;Today I would like to present you a small JAVA Program to &lt;span style="font-weight:bold;"&gt;Display a Multiplication Table using Singleton Pattern&lt;/span&gt; in between two ranges.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Logic:&lt;/span&gt; Accept the table which you want to display, then get the upper and lower bounds to display and display the table.&lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;Code:&lt;/span&gt;&lt;br /&gt;package chandra.multiplicationTable;&lt;br /&gt;&lt;br /&gt;import java.io.BufferedReader;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;import java.io.InputStreamReader;&lt;br /&gt;&lt;br /&gt;public class Multiply {&lt;br /&gt; private static Multiply chandraSample = null;&lt;br /&gt; static int flag = 1;&lt;br /&gt; static BufferedReader bufferedReader;&lt;br /&gt;&lt;br /&gt; public static Multiply getInstance() throws IOException {&lt;br /&gt;  if (chandraSample == null) {&lt;br /&gt;   flag = 1;&lt;br /&gt;   chandraSample = new Multiply();&lt;br /&gt;   flag = 0;&lt;br /&gt;  } &lt;br /&gt;  else {  &lt;br /&gt;   System.out.println("Error");&lt;br /&gt;   return chandraSample;&lt;br /&gt;  }&lt;br /&gt;  return chandraSample;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public Multiply() throws IOException {&lt;br /&gt;  System.out.println("Multiplication Table");&lt;br /&gt;  System.out.println("Enter the number for which you want to display");&lt;br /&gt;  try {&lt;br /&gt;   bufferedReader = new BufferedReader(&lt;br /&gt;     new InputStreamReader(System.in));&lt;br /&gt;   String st1 = bufferedReader.readLine();&lt;br /&gt;   double mulValue = Double.parseDouble(st1);&lt;br /&gt;&lt;br /&gt;   System.out.println("Enter the first range value:");&lt;br /&gt;   String st2 = bufferedReader.readLine();&lt;br /&gt;   double firstValue = Double.parseDouble(st2);&lt;br /&gt;&lt;br /&gt;   System.out.println("Enter the last range value:");&lt;br /&gt;   String st3 = bufferedReader.readLine();&lt;br /&gt;   double lastValue = Double.parseDouble(st3);&lt;br /&gt;   compute(mulValue, firstValue, lastValue);&lt;br /&gt;  } &lt;br /&gt;  &lt;br /&gt;  catch (Exception e) {&lt;br /&gt;   System.out.println("Enter only numbers");&lt;br /&gt;   Multiply.getInstance();&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public static void main(String[] args) throws IOException {&lt;br /&gt;  Multiply multiply = Multiply.getInstance();&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public static int compute(double mvalue, double fvalue, double lvalue)&lt;br /&gt;   throws IOException {&lt;br /&gt;  double i;&lt;br /&gt;  double disp;&lt;br /&gt;  if ((fvalue &lt; lvalue) || (fvalue == lvalue)) {&lt;br /&gt;   for (i = fvalue; i &lt;= lvalue; i++) {&lt;br /&gt;&lt;br /&gt;    System.out.print(mvalue + " * " + (i) + " = ");&lt;br /&gt;    disp = i * mvalue;&lt;br /&gt;&lt;br /&gt;    System.out.println(disp);&lt;br /&gt;   }&lt;br /&gt;   System.out.println("Do u Want to Continue: yes/no");&lt;br /&gt;   String yn1 = bufferedReader.readLine();&lt;br /&gt;   if (yn1.equalsIgnoreCase("yes") || yn1.equalsIgnoreCase("y")) {&lt;br /&gt;    Multiply.getInstance();&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   else if (yn1.equalsIgnoreCase("no") || yn1.equalsIgnoreCase("n")) {&lt;br /&gt;    System.exit(0);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   else {&lt;br /&gt;&lt;br /&gt;    System.out.println("Totally irrelevant input! System will exit!");&lt;br /&gt;    System.exit(0);&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  else {&lt;br /&gt;   System.out.println("Enter correct data!");&lt;br /&gt;   Multiply.getInstance();&lt;br /&gt;  }&lt;br /&gt;  return 1;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Output:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Multiplication Table&lt;br /&gt;Enter the number for which you want to display&lt;br /&gt;2&lt;br /&gt;Enter the first range value:&lt;br /&gt;3&lt;br /&gt;Enter the last range value:&lt;br /&gt;12&lt;br /&gt;2.0 * 3.0 = 6.0&lt;br /&gt;2.0 * 4.0 = 8.0&lt;br /&gt;2.0 * 5.0 = 10.0&lt;br /&gt;2.0 * 6.0 = 12.0&lt;br /&gt;2.0 * 7.0 = 14.0&lt;br /&gt;2.0 * 8.0 = 16.0&lt;br /&gt;2.0 * 9.0 = 18.0&lt;br /&gt;2.0 * 10.0 = 20.0&lt;br /&gt;2.0 * 11.0 = 22.0&lt;br /&gt;2.0 * 12.0 = 24.0&lt;br /&gt;Do u Want to Continue: yes/no&lt;br /&gt;yes&lt;br /&gt;Multiplication Table&lt;br /&gt;Enter the number for which you want to display&lt;br /&gt;3&lt;br /&gt;Enter the first range value:&lt;br /&gt;0&lt;br /&gt;Enter the last range value:&lt;br /&gt;10&lt;br /&gt;3.0 * 0.0 = 0.0&lt;br /&gt;3.0 * 1.0 = 3.0&lt;br /&gt;3.0 * 2.0 = 6.0&lt;br /&gt;3.0 * 3.0 = 9.0&lt;br /&gt;3.0 * 4.0 = 12.0&lt;br /&gt;3.0 * 5.0 = 15.0&lt;br /&gt;3.0 * 6.0 = 18.0&lt;br /&gt;3.0 * 7.0 = 21.0&lt;br /&gt;3.0 * 8.0 = 24.0&lt;br /&gt;3.0 * 9.0 = 27.0&lt;br /&gt;3.0 * 10.0 = 30.0&lt;br /&gt;Do u Want to Continue: yes/no&lt;br /&gt;no&lt;br /&gt;&lt;br /&gt;Dear friends,&lt;br /&gt;Kindly have a look at the program and report bugs. It will be helpful to readers as well as me. Thanks for your co-operation and support!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-7695417629270151708?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/7695417629270151708/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=7695417629270151708&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/7695417629270151708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/7695417629270151708'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/07/multiplicaton-table-using-singleton.html' title='Multiplicaton Table using Singleton Pattern'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-1756784721001134344</id><published>2009-07-29T09:09:00.004+05:30</published><updated>2009-08-10T09:49:00.646+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Sample Program Using JEP.</title><content type='html'>Hi friends,&lt;br /&gt;Today I would like to share a program that uses &lt;span style="font-weight:bold;"&gt;Java Expressioin Parser&lt;/span&gt;(JEP).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Logic Of the program:&lt;/span&gt; Addition Of three numbers.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Code:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;package jeptrial;&lt;br /&gt;&lt;br /&gt;import java.io.BufferedReader;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;import java.io.InputStreamReader;&lt;br /&gt;&lt;br /&gt;import com.singularsys.jep.Jep;&lt;br /&gt;&lt;br /&gt;public class MainClass {&lt;br /&gt; public MainClass() throws IOException {&lt;br /&gt;  Jep jep = new Jep();&lt;br /&gt;  Object o = null;&lt;br /&gt;  System.out.println("Enter value for a,b and c");&lt;br /&gt;  BufferedReader bufferedReader = new BufferedReader(&lt;br /&gt;    new InputStreamReader(System.in));&lt;br /&gt;  String st1 = bufferedReader.readLine();&lt;br /&gt;  int a = Integer.parseInt(st1);&lt;br /&gt;  String st2 = bufferedReader.readLine();&lt;br /&gt;  int b = Integer.parseInt(st2);&lt;br /&gt;  String st3 = bufferedReader.readLine();&lt;br /&gt;  int c = Integer.parseInt(st3);&lt;br /&gt;  try {&lt;br /&gt;   jep.addVariable("value1", a);&lt;br /&gt;   jep.addVariable("value2", b);&lt;br /&gt;   jep.addVariable("value3", c);&lt;br /&gt;&lt;br /&gt;   jep.parse("value1+value2+value3");&lt;br /&gt;   o = jep.evaluate();&lt;br /&gt;   System.out.println("The sum of the three numbers is " + o);&lt;br /&gt;  } catch (Exception e) {&lt;br /&gt;   // TODO: handle exception&lt;br /&gt;   System.out.println("Exception :" + e);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public static void main(String[] args) throws IOException {&lt;br /&gt;  MainClass mainClass = new MainClass();&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Output:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Enter value for a,b and c&lt;br /&gt;1&lt;br /&gt;2&lt;br /&gt;3&lt;br /&gt;The sum of the three numbers is 6.0&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-1756784721001134344?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/1756784721001134344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=1756784721001134344&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/1756784721001134344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/1756784721001134344'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/07/sample-program-using-jep.html' title='Sample Program Using JEP.'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-6912976744271157245</id><published>2009-07-27T09:27:00.006+05:30</published><updated>2009-08-10T09:55:03.037+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Quick Sort program in JAVA</title><content type='html'>Hi Friends,&lt;br /&gt;Today I would like to give a program for Quick Sort.&lt;br /&gt;&lt;br /&gt;package Quick_Sort;&lt;br /&gt;import java.io.*;&lt;br /&gt;import java.util.*;&lt;br /&gt;&lt;br /&gt;public class quick_Sort {&lt;br /&gt;	static Scanner sc = new Scanner(System.in);&lt;br /&gt;	static int NodeValue = 0;&lt;br /&gt;	static int arrsize = 0;&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;        static int getTotalElement(String str) {&lt;br /&gt;		System.out.println(str);&lt;br /&gt;		NodeValue = sc.nextInt();&lt;br /&gt;		return NodeValue;&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;	static int getElement(String str) {&lt;br /&gt;		System.out.println(str);&lt;br /&gt;		int ret = sc.nextInt();&lt;br /&gt;		return ret;&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;	static int putElement() {&lt;br /&gt;		return NodeValue;&lt;br /&gt;	}&lt;br /&gt;        &lt;br /&gt;    public static void main(String[] args) {&lt;br /&gt;        int no_Elements = 0;&lt;br /&gt;        int i = 0;&lt;br /&gt;       &lt;br /&gt;        no_Elements = getTotalElement("Enter the total number of elements :");&lt;br /&gt;	Element element1 = new Element();&lt;br /&gt;	int[] OriginalArray= element1.Elementarray;&lt;br /&gt;		&lt;br /&gt;	for (i = 0; i &lt; no_Elements; i++) {&lt;br /&gt;            int value = getElement("Enter the element " + i + " :");&lt;br /&gt;            element1.getElementId(value, i);&lt;br /&gt;		}&lt;br /&gt;        element1.getquicksort(OriginalArray,0,no_Elements-1);&lt;br /&gt;        element1.display();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class Element {&lt;br /&gt;	quick_Sort qs = new quick_Sort();&lt;br /&gt;    private int val = qs.putElement();&lt;br /&gt;    public int[] Elementarray = new int[val];&lt;br /&gt;    &lt;br /&gt;    public void getElementId(int value, int val1) {&lt;br /&gt;		Elementarray[val1] = value;&lt;br /&gt;	}&lt;br /&gt;    &lt;br /&gt;    public void getquicksort(int Elementarray[],int first,int last){&lt;br /&gt;        if (first&lt;last)&lt;br /&gt;	{&lt;br /&gt;        int pivot=Elementarray[first];&lt;br /&gt;	int i=first;&lt;br /&gt;	int j=last;&lt;br /&gt;        while(i&lt;j){&lt;br /&gt;            while(Elementarray[i]&lt;=pivot &amp;&amp; i&lt;last)&lt;br /&gt;	    i++;&lt;br /&gt;	while(Elementarray[j] &gt;= pivot &amp;&amp; j&gt;first)&lt;br /&gt;	    j--;&lt;br /&gt;	if(i&lt;j)&lt;br /&gt;	   swap(Elementarray,i,j);&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;        swap(Elementarray,first,j);&lt;br /&gt;	getquicksort(Elementarray,first,j-1);&lt;br /&gt;	getquicksort(Elementarray,j+1,last);&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    void swap(int Elementarray[],int i,int j)&lt;br /&gt;	{&lt;br /&gt;	int temp;&lt;br /&gt;	temp=Elementarray[i];&lt;br /&gt;	Elementarray[i]=Elementarray[j];&lt;br /&gt;	Elementarray[j]=temp;&lt;br /&gt;	}&lt;br /&gt;    void display(){&lt;br /&gt;        System.out.println("The sorted list is :");&lt;br /&gt;	for(int i=0;i&lt;val;i++)&lt;br /&gt;	System.out.println(Elementarray[i]);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This program runs on jdk 1.5&lt;br /&gt;versions less than jdk 1.5 are not compatible.&lt;br /&gt;Hope my program was useful to you, please post your valuable feedback!&lt;br /&gt;And your problems too. I hope to be of help when required.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-6912976744271157245?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/6912976744271157245/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=6912976744271157245&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/6912976744271157245'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/6912976744271157245'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/07/quick-sort-program-in-java.html' title='Quick Sort program in JAVA'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-8967455909978606038</id><published>2009-07-24T09:28:00.008+05:30</published><updated>2009-08-10T09:50:06.611+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Information Is Wealth'/><title type='text'>10 Most Dangerous Places For Shark Attacks</title><content type='html'>Hi Friends,&lt;br /&gt;&lt;br /&gt;If you've seen the 1975 film "&lt;span style="font-weight:bold;"&gt;Jaws&lt;/span&gt;" then you might think that a little New England town called Amity Island is the most dangerous place for shark attacks.&lt;br /&gt;While Amity Island isn't a real place, the events of the movie and book were likely based on some real-life attacks that occurred in 1916. In just 12 days, a shark killed four people and mauled seven others along the coast of New Jersey. People were in a panic; just a year earlier, the New York Times had said that sharks didn't seem to be dangerous in U.S. waters . In the absence of Roy Schneider and Richard Dreyfuss, U.S. President Woodrow Wilson had to handle the crisis. Wilson held special meetings with his Cabinet and dispatched the U.S. Navy and the U.S. Coast Guard to get rid of these menaces of the sea.&lt;br /&gt;­­So before you load up the car for a beach trip, take a look at this list of places that rank high for shark attacks. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;10. Papua New Guinea&lt;/span&gt; &lt;br /&gt; Papua New Guinea is the eastern half of the island of New Guinea, the world's largest tropical island. Located in the Pacific Ocean, Papua New Guinea has logged 49 shark attacks and 25 fatalities since 1925. These numbers just edge out New Zealand, which has seen 47 attacks and 9 fatalities since 1852. However, New Zealand has 9,404 miles (15,134 kilometers) of shoreline, while Papua New Guinea has but 3,201 miles (5,152 kilometers) of coast. &lt;br /&gt;The waters of Papua New Guinea contain a wide array of marine environments, so divers from all over the world come to the island to see the immense variety of aquatic life, with shark dives one of the popular options. It's not clear if Papua New Guinea's shark attacks stem from divers and other tourists, or if the attacks stem from the local habit of fishing for sharks. Fisheries in Papua New Guinea exported $1.2 million in shark fin products in 1999&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;9. South Carolina&lt;/span&gt;&lt;br /&gt;­Since 1837, 61 shark attacks and two fatalities have occurred in South Carolina. Though they occur all along the state's coastline, the majority have occurred in Horry County, home to popular Myrtle Beach. As this list will reveal, more people in the water generally increases the chance of a shark attack. &lt;br /&gt;Almost 40 species of shark are indigenous to South Carolina's waters. The species are generally mild, including the sandbar and bonnethead sharks, but more aggressive species, including the tiger and the bull shark have been spotted. South Carolina's offshore estuaries provide good birthing and feeding grounds for these sharks.&lt;br /&gt;Several factors keep South Carolina from being as dangerous a place as, say, Florida. At North Myrtle Beach, the continental shelf, where sharks find many fish to feast on, is located 50 miles (80.5 kilometers) out from the coastline. In Florida, that shelf can come within a mile of the shore. We'll have much more on Florida later, but as another comparison, the waves are generally milder at beaches such as Myrtle, so fish aren't being thrown inshore with sharks in hot pursuit.&lt;br /&gt;It should be noted that escaping to the other Carolina won't eliminate the threat of sharks. North Carolina is no slouch in the shark attack department either, with 32 attacks and 3 fatalities.&lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;8. California&lt;/span&gt;&lt;br /&gt;­ When Dave Martin was mauled to death by a shark in San Diego in 2008, it surprised some shark researchers. Since 1926, San Diego has only had 10 attacks and one fatality. Shark attacks in California are much more likely to occur farther north, in the infamous Red Triangle. &lt;br /&gt;About 90 miles (145 kilometers) of Northern California coastline between Point Reyes and Monterey Bay form one side of the Red Triangle; from those two points, lines extend to meet just past the Farallon Islands, to the west of San Francisco. These waters are home to lots of seals, which in turn attract lots of great white sharks.&lt;br /&gt;But within the Red Triangle are many beaches that are attract surfers, including Bolinas Beach and Stinson Beach. One tour guide operator deemed Stinson "&lt;span style="font-weight:bold;"&gt;The granddaddy of all shark beaches&lt;/span&gt;". While the Red Triangle is known for the great whites, the rest of the state's coastline also holds the possibility of attack. Since 1926, 96 attacks and 7 fatalities have occurred in this state&lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;7. Brazil&lt;/span&gt;&lt;br /&gt;­­ When you look at the whole continent of South America, 101 attacks and 23 fatalities have occurred since 1931. But look closer, and you'll see that 89 of those attacks and 21 of those fatalities have occurred just in Brazil. What's bringing all these sharks to Brazil? A tiny beach town named Recife, which has had some unfortunate luck in attracting sharks to its coastline. &lt;br /&gt;The trouble started in the 1980s, when Porto Suape was constructed to the south of Recife. The construction sealed off two freshwater estuaries, which had served as the birthing waters for many bull sharks. When the estuaries were closed, the sharks went to the next estuary, which happens to discharge right into Recife's waters. A nearby channel used by surfers became these sharks' new feeding grounds. The sharks may have been driven even closer to Recife's shore by a slaughterhouse, which was disposing of blood in nearby tributaries.&lt;br /&gt;Since these events, Recife's 12.5-mile (20-kilometer) coastline has become an extremely dangerous place, with a higher proportion of attacks resulting in death. One in three shark attacks that occur in Recife are fatal &lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;6. Brevard County, Fla.&lt;/span&gt;&lt;br /&gt;­ Of the 71 attacks that occurred in the world in 2007, 32 of them happened in Florida. Florida has so many attacks that it warrants two spots on this list, the first being the beaches that make up Brevard County. In the waters off Brevard County, 90 attacks and one fatality have occurred since 1882. &lt;br /&gt;Florida has a lot of shark attacks simply because it has a lot of tourists, and Brevard County is an easy hour-long drive for those already in the area to see Mickey at Disney World in Orlando. The county is home to the famed "&lt;span style="font-weight:bold;"&gt;Space Coast&lt;/span&gt;" 70 miles (113 kilometers) of coastline named for the space center at Cape Canaveral. In addition to the Canaveral National Seashore, visitors can also enjoy Cocoa Beach and Melbourne Beach.&lt;br /&gt;While the shark attacks are nothing to sneeze at, Brevard County is dangerous for a few other reasons as well. In 2008, Forbes named Brevard County beaches the most dangerous place for rip current drowning. In 2007, 10 people drowned because of the rip currents, a rate that's higher than any other county in the United States. Parts of this coastline also fall into Florida's "&lt;span style="font-weight:bold;"&gt;Lightning Alley&lt;/span&gt;" an area that has the most lightning in the United States. So when you're not worrying about sharks, worry about the forecast.&lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;5. Queensland, Australia&lt;/span&gt;&lt;br /&gt; In 2006, Sarah Kate Whitley was swimming near Brisbane in water no higher than her waist when she was attacked by three bull sharks, which tore off both of her arms while biting her stomach and legs. Her death is just one of Queensland's 38 fatalities and 103 attacks since 1700.&lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;4. Hawaii&lt;/span&gt;&lt;br /&gt;­ What's a trip to Hawaii without a stop in Oahu or Maui? Almost half of Hawaii's 113 shark attacks since 1882 have occurred off the coasts of these two islands, with 36 attacks and three fatalities occurring in Maui and 34 attacks and six fatalities in Oahu. Other islands aren't safe either, with 19 attacks occurring off Kauai and 12 off the big island of Hawaii. &lt;br /&gt;This total is fairly low when you consider the millions of tourists who visit each year, but you should still be on the lookout for the approximately 40 species of shark that call Hawaii home. One of these species is the dangerous tiger shark, responsible for the most attacks on humans after the great white.&lt;br /&gt;Hawaii has a mixed record when it comes to dealing with sharks. On the one hand, a 1959 fatal attack led to a decades-long shark eradication program sponsored by the government. On the other hand, some native Hawaiians call the tiger shark aumakua, or guardian spirit.&lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;3. New South Wales, Australia&lt;/span&gt;&lt;br /&gt;­ Like its neighbor to the north, Queensland, New South Wales along Australia's eastern coast is home to some beautiful beaches, which in turn are home to quite a lot of sharks. New South Wales has seen 140 attacks and 61 fatalities since 1700, according to the International Shark Attack File. &lt;br /&gt;Some recent attacks as of press time also helped this sunny locale rank so high on our list. In 2008, a 16-year-old surfer was mauled to death by a bull shark while bodyboarding, just a few months after an incident in which divers were held hostage at a shipwreck by a circling shark, and another instance where a woman was knocked off her surfski by a white pointer shark. Prior to the 16-year-old's fatal attack, it had been 15 years since a shark-related death occurred in New South Wales.&lt;br /&gt;Still, Queensland's numbers have likely been kept low by protective measures taken at beaches near Sydney. In 1937, nets and mesh were installed in the waters, and the program was expanded in the early 1960s after a spate of fatal attacks. As of 2006, 84 beaches were protected by these nets or by drumlines, baited hooks intended to attract the sharks. These measures have caused a dramatic dip in the number of attacks and also in the number of sharks.&lt;br /&gt;However, these nets are controversial among conservationists, as we mentioned in the Queensland entry. These conservationists argue that the nets trap and kill endangered species, while not always stopping sharks. For these reasons, the environmentalists favor building caged enclosures for swimmers. &lt;br /&gt;Speaking of cages, our next location is famous for people using them to go swimming with sharks. Turn the page to find out about shark diving.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;2. South Africa&lt;/span&gt;&lt;br /&gt;­ You might think that 214 shark attacks and 42 fatalities in the past 100 years would keep folks away from the waters of South Africa, but that doesn't seem to be the case. More and more people are flocking to South African waters to dive with sharks. &lt;br /&gt;There's plenty of them to find! South Africa was the first countries to formally protect great white sharks, so their populations have grown. You can see mako, ragged tooth, tiger, hammerhead, bull and blacktip sharks, just to name a few. Near Kosi Bay you'll find tenacious bull sharks known locally as Zambezi. Dyer Island, near Capetown, has earned the nickname "&lt;span style="font-weight:bold;"&gt;Shark Alley&lt;/span&gt;" for the many species of sharks in the water, particularly a high number of great white sharks. These great whites spend their time stalking Geyser Rock, home to more than 50,000 seals.&lt;br /&gt;While shark diving may provide thrills galore, the industry is extremely controversial. Some blame shark diving, a somewhat haphazardly regulated industry, for recent shark attacks, because it encourages sharks to come closer to shore than they normally do. Proponents say it's safe and provides a way to learn more about sharks in their natural environment. One tour guide has claimed that he doesn't even bother with the cage when diving with sharks.&lt;br /&gt;On the flip side, however, another tour guide was injured because his foot was hanging over the side of the boat as he baited the waters to draw the great whites closer. Chumming the water, or putting a mix of fish blood and guts into the water, could change a shark's natural behavior. With each new attack, some worry that the sight of humans may become linked to the promise of food, increasing the danger for unsuspecting divers who have no food to offer.&lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;1. Volusia County, Fla.&lt;/span&gt; &lt;br /&gt;­ It may seem strange for the No. 2 dangerous spot to outrank the No. 1 most dangerous spot in number of attacks; South Africa, as we mentioned, boasts 214 attacks and 42 fatalities, while Volusia County, Florida ranks just behind with 210 attacks since 1882, none of them fatal. Yet what's worth remembering here is that South Africa's attacks occurred over 2,798 miles (4,503 kilometers) of coastline, while these 210 attacks occurred in a single county. &lt;br /&gt;Indeed, at New Smyrna Beach, located in Volusia, there are more incidents per square mile than on any other beach in the world. If you've been swimming at New Smyrna, you've probably been within 10 feet (3 meters) of a shark. These distinctions have earned New Smyrna Beach the nickname "&lt;span style="font-weight:bold;"&gt;Shark Attack Capital of the World.&lt;/span&gt;"&lt;br /&gt;Are the people swimming at New Smyrna Beach particularly delicious? Are the sharks hungrier here? While the area is home to many baitfish, a common prey for these sharks, the real reason for the high number of attacks is simply the number of people in the water. Swimmers and fishermen flock to these waters, and the beaches in this county are some of the most popular in the state for surfing.&lt;br /&gt;Being known as the "shark attack capital of the world" doesn't seem to dissuade surfers and swimmers, though. In fact, the deputy beach chief reported that when he closes the beaches following shark sightings and attacks, he receives angry voice mail messages. That may be because attacks in Volusia County are fairly mild and are usually just minor bites. Some shark attack victims even drive themselves to the hospital.&lt;br /&gt;&lt;br /&gt;So friends, Hope this information was useful to you. Please give your valuable suggestions! Have a Good Day!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-8967455909978606038?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/8967455909978606038/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=8967455909978606038&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/8967455909978606038'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/8967455909978606038'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/07/10-most-dangerous-places-for-shark.html' title='10 Most Dangerous Places For Shark Attacks'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-3730097743368721856</id><published>2009-07-22T09:55:00.011+05:30</published><updated>2009-08-10T09:50:39.335+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Information Is Wealth'/><title type='text'>Some Notorious Art Thefts</title><content type='html'>Hi Friends,&lt;br /&gt;&lt;br /&gt;Some people just can't keep their hands off other people's things , even the world's greatest art. Art thieves take their loot from museums, places of worship, and private residences. Because they would have trouble selling the fruits of their labor on the open market as auction houses and galleries tend to avoid stolen works , art burglars often either keep the art for themselves or try to ransom the hot property back to the original owner. &lt;br /&gt;&lt;br /&gt;Today I would like to post the &lt;span style="font-weight:bold;"&gt;daring thefts of very expensive art&lt;/span&gt; from the major robberies in the past hundred years (values estimated at the time of the theft).&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Boston, March 1990: $300 million&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; Two men dressed as police officers visited the &lt;span style="font-weight:bold;"&gt;Isabella Stewart Gardner Museum&lt;/span&gt; in the wee hours of the morning. After overpowering two guards and grabbing the security system's surveillance tape, they collected Rembrandt's only seascape, &lt;span style="font-weight:bold;"&gt;Storm on the Sea of Galilee&lt;/span&gt;, as well as Vermeer's &lt;span style="font-weight:bold;"&gt;The Concert, Manet's Chez Tortoni&lt;/span&gt;, and several other works. Authorities have yet to find the criminals despite investigating everyone from the Irish Republican Army to a Boston mob boss! &lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Oslo, August 2004: $120 million&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; Two armed and masked thieves threatened workers at the Munch Museum during a daring daylight theft. They stole a pair of Edvard Munch paintings, The Scream and The Madonna, estimated at a combined value of 100 million euros. In May 2006, authorities convicted three men who received between four and eight years in jail. The paintings were recovered three months later.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Paris, August 1911: $100 million&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; In the world's most notorious art theft to date, &lt;span style="font-weight:bold;"&gt;Vincenzo Peruggia&lt;/span&gt;, an employee of the Louvre, stole &lt;span style="font-weight:bold;"&gt;Leonardo da Vinci's Mona Lisa&lt;/span&gt; from the storied museum in the heart of Paris. Peruggia simply hid in a closet, grabbed the painting once alone in the room, hid it under his long smock, and walked out of the famed museum after it had closed. The theft turned the moderately popular Mona Lisa into the best-known painting in the world. Police questioned Pablo Picasso and French poet Guillaume Apollinaire about the crime, but they found the real thief and the Mona Lisa two years later when Peruggia tried to sell it to an art dealer in Florence.&lt;br /&gt; &lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Oslo, February 1994: $60-75 million&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;The Scream&lt;/span&gt; has been a popular target for thieves in Norway. On the day the 1994 Winter Olympics began in Lillehammer, a different version of Munch's famous work (he painted four) was taken from Oslo's &lt;span style="font-weight:bold;"&gt;National Art Museum&lt;/span&gt;. In less than one minute, the crooks came in through a window, cut the wires holding up the painting, and left through the same window. They attempted to ransom the painting to the Norwegian government, but they had left a piece of the frame at a bus stop, a clue that helped authorities recover the painting within a few months. Four men were convicted of the crime in January 1996.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Scotland, August 2003: $65 million&lt;/span&gt; &lt;br /&gt;&lt;br /&gt; Blending in apparently has its advantages for art thieves. Two men joined a tour of &lt;span style="font-weight:bold;"&gt;Scotland's Drumlanrig Castle&lt;/span&gt;, subdued a guard, and made off with &lt;span style="font-weight:bold;"&gt;Leonardo da Vinci's Madonna with the Yarnwinder&lt;/span&gt;. Alarms around the art were not set during the day, and the thieves dissuaded tourists from intervening, reportedly telling them: "Don't worry . . . we're the police. This is just practice." Escaping in a white Volkswagen Golf, the perpetrators have never been identified!  and the painting remains missing.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Stockholm, December 2000: $30 million&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;Caught! Eight criminals each got up to six and half years behind bars for conspiring to take a &lt;span style="font-weight:bold;"&gt;Rembrandt and two Renoirs&lt;/span&gt; thankfully all of them eventually recovered  from &lt;span style="font-weight:bold;"&gt;Stockholm's National Museum&lt;/span&gt;. You have to give the three masked men who actually grabbed the paintings credit for a dramatic exit. In a scene reminiscent of an action movie, they fled the scene by motorboat. Police unraveled the plot after recovering one of the paintings during an unrelated drug investigation four months after the theft.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Amsterdam, December 2002: $30 million&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Robbers used a ladder to get onto the roof of the &lt;span style="font-weight:bold;"&gt;Van Gogh Museum&lt;/span&gt;, then broke in and stole two of the &lt;span style="font-weight:bold;"&gt;Dutch master's paintings, View of the Sea at Scheveningen and Congregation Leaving the Reformed Church in Nuenen, together worth $30 million&lt;/span&gt;. Police told the press that the thieves worked so quickly that, despite setting off the museum's alarms, they had disappeared before police could get there. Authorities in the Netherlands arrested two men in 2003, based on DNA from hair inside two hats left at the scene, but they have been unable to recover the paintings, which the men deny taking.&lt;br /&gt;&lt;br /&gt;So friends, Hope you had a nice time reading this article! Please give me your valuable suggestions and comments!They are always welcome!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-3730097743368721856?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/3730097743368721856/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=3730097743368721856&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/3730097743368721856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/3730097743368721856'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/07/some-notorious-art-thefts.html' title='Some Notorious Art Thefts'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-3810286233974945547</id><published>2009-07-20T09:44:00.009+05:30</published><updated>2009-08-10T09:53:14.084+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Information Is Wealth'/><title type='text'>Some Outrageous Lawsuits</title><content type='html'>Hi friends,&lt;br /&gt;&lt;br /&gt;One of the benefits of living in a democratic country with a well-established judicial system is the opportunity to use the courts to achieve justice and set wrongs right. But there is also a drawback! Some folks go to court about things that make most of us shake our heads. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Can't beleive it? Let's see what we have today!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Today I would like to post some very Hilarious and Outrageous Lawsuits.Read and Enjoy!&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;All Toys Are Not Equal&lt;/span&gt;&lt;br /&gt; Jodee Berry, a Hooter's waitress in Florida, won the restaurant's sales contest and thought she'd just won the new Toyota that her bosses said the champion would get. The prize was actually a toy Yoda, not a Toyota, so she left her job and sued the franchisee for breach of contract and fraudulent misrepresentation. The force was with Berry: The out-of-court settlement in May 2002 allowed her to pick out any Toyota car she wanted.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;No Good Deed Goes Unpunished&lt;/span&gt;&lt;br /&gt; In July 2004, two teenage girls in Colorado baked cookies and delivered them to their neighbors. But the door-knocking apparently scared Wanita Young, who had an anxiety attack, went to the hospital, and sued the girls' families. A local judge awarded Young almost $900 for medical expenses but denied her half-baked demand for nearly $3,000 in itemized expenses, including lost wages and new motion-sensor lights for her porch.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Bubbles Aren't Always Fun&lt;/span&gt;&lt;br /&gt; Early on the morning of July 7, 2001, a prankster dumped detergent into a public park fountain in Duluth, Minnesota, creating a mountain of bubbles. A few hours later, passerby Kathy Kelly fell down and suffered several injuries. She sued the city because it had not cleaned up the suds (on Saturday morning) or posted warnings to citizens urging them not to walk through the slippery wall of bubbles. A jury in March 2004 found the city 70 percent responsible for Kelly's injuries leaving her with only 30 percent of the blame and thus awarded her $125,000.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Sue the Pants Off Them&lt;/span&gt;&lt;br /&gt; In 2005, in one of the most outrageous lawsuits of recent times, Roy Pearson, a Washington, D.C. judge, sued a small mom-and-pop dry cleaner for $54 million for misplacing his pants. The shop's owners, Jin and Soo Chung, returned the pants a week later, but Pearson refused them, saying they were not his $800 trousers but a cheap imitation. He also sued the Chungs and their son $1,500 each, per day for more than a year, claiming that the store's signs, which read "Satisfaction Guaranteed" and "Same Day Service," were fraudulent. In 2007, a judge ruled in favor of the Chungs and ordered Pearson to pay the couple's court costs, and possibly their attorney fees as well.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Trespass at the Owner's Risk&lt;/span&gt;&lt;br /&gt; Let's say you're illegally sneaking onto a railroad's property so you can get a view from the top of a boxcar -- and then an electrical wire above the car electrocutes you. What do you do? Obviously, you sue the railroad! In October 2006, a jury awarded more than $24 million to two young men who were severely burned while atop a parked railroad car in Lancaster, Pennsylvania, in 2002.&lt;br /&gt; The jury said that, although they were trespassing, the 17-year-old boys bore no responsibility. Instead the blame fell entirely on Amtrak and Norfolk Southern for failing to post signs warning of the danger from the electrified wires that power locomotives. For medical costs, pain and suffering, and "loss of life pleasures," one boy received $17.3 million and the other $6.8 million.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;School Responsible for Bad Break-Up&lt;/span&gt; &lt;br /&gt; In February 2004, a New York court ordered a school district to pay a former student $375,000 when his two-year affair with a school secretary ended. The young basketball star claimed that the break-up brought "emotional and psychological trauma," ruining any prospects for a professional hard-court career. The jury determined that the school was culpable for failing to supervise the secretary properly. It also ordered the secretary to pay the student another $375,000 -- even though she had not been named in the lawsuit.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Fingered as a Scam&lt;/span&gt;&lt;br /&gt; In March 2005, Ann Ayala filed a claim against a Wendy's franchise owner, asserting that she had found a fingertip in a bowl of chili. But authorities found no evidence of missing fingers at the accused restaurant. Suspicion turned on Ayala, who dropped the suit when reporters discovered that she had previously accused several other companies of wrongdoing.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Spilling the (Coffee) Beans &lt;/span&gt;&lt;br /&gt; This list can only end with the most notorious of lawsuits: Stella Liebeck, of Albuquerque, sued McDonald's in 1992 after spilling a cup of the restaurant's coffee, which burned her lap severely and hospitalized her for a week. Two years later, a jury awarded her $160,000 in direct damages and $2.7 million in punitive damages, which a court later reduced to $480,000. Both parties appealed, and they eventually settled out of court for an undisclosed amount surely enough for her to buy McDonald's coffee for the rest of her life. Liebeck inspired the creation of the Stella Awards, which highlight particularly "wild, outrageous, or ridiculous lawsuits."&lt;br /&gt;&lt;br /&gt;So friends, today we had a hilarious moment and let us know if you too have come across some hilarious moments as this!&lt;br /&gt;Please comment! Your comments are Welcome!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-3810286233974945547?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/3810286233974945547/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=3810286233974945547&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/3810286233974945547'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/3810286233974945547'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/07/some-outrageous-lawsuits.html' title='Some Outrageous Lawsuits'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-7397941774068362231</id><published>2009-07-18T13:29:00.010+05:30</published><updated>2009-07-18T13:47:26.053+05:30</updated><title type='text'>Information On How To Buy A Scanner</title><content type='html'>Hi Friends,&lt;br /&gt;&lt;br /&gt;Today I would like to share some points in a technical aspect. When we need to buy a desktop, we are aware of what configuration we needed, etc. But not many of us know as to which type of Scanner suits our requirements best.&lt;br /&gt;So in this article, I would like to focus on the various Scanners you need to know to fulfill your requirements.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Identify The Requirement Of The Scanner&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;*I would advice you to buy a &lt;span style="font-weight:bold;"&gt;low-resolution scanner&lt;/span&gt; if you will use it just to &lt;span style="font-weight:bold;"&gt;scan text&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;* If you don't plan to scan from books or magazines, consider a &lt;span style="font-weight:bold;"&gt;sheet-fed unit&lt;/span&gt;, which takes up far less desk space than a flatbed scanner.&lt;br /&gt;&lt;br /&gt;* You can Use A &lt;span style="font-weight:bold;"&gt;Flatbed scanner&lt;/span&gt; in case you want to &lt;span style="font-weight:bold;"&gt;scan books&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;* Purchase a &lt;span style="font-weight:bold;"&gt;low-resolution or medium-resolution scanner&lt;/span&gt; if you plan to &lt;span style="font-weight:bold;"&gt;scan photographs to use on the Internet&lt;/span&gt;, as the resolution of Web graphics is low anyway.&lt;br /&gt;&lt;br /&gt;* Buy a &lt;span style="font-weight:bold;"&gt;High-resolution scanner&lt;/span&gt; if you plan to &lt;span style="font-weight:bold;"&gt;scan photographs to print&lt;/span&gt; and you have a high-resolution printer (greater than 600-by-600 dots per inch, or dpi).&lt;br /&gt;&lt;br /&gt;* Buy a model with &lt;span style="font-weight:bold;"&gt;36-bit color depth&lt;/span&gt; if you plan to &lt;span style="font-weight:bold;"&gt;scan photographs&lt;/span&gt; or color graphics.&lt;br /&gt;&lt;br /&gt;* I would prefer you to buy a &lt;span style="font-weight:bold;"&gt;Parallel-port scanner&lt;/span&gt; if you don't expect to use the scanner often or work with large files.&lt;br /&gt;&lt;br /&gt;* Scanners that cost less than $100 will provide a good picture of 600-by-1,200-dpi resolution. Scanners priced between $150 and $250 usually provide 1,200-by-1,200-dpi resolution.&lt;br /&gt;&lt;br /&gt;* Last but definitely not the least, Please know that &lt;span style="font-weight:bold;"&gt;speed is the biggest factor in pricing&lt;/span&gt;. Parallel-port scanners, which use your existing printer port, are the cheapest and slowest. USB scanners, which require that your computer have a USB port, are faster and cost more. SCSI-card scanners are the fastest and most expensive. You need to install a SCSI card in your computer if it does not have one.&lt;br /&gt;&lt;br /&gt;Hope my article was useful! Please give me suggestions that might add to the content for better satisfaction of the readers.&lt;br /&gt;Your Feedbacks are welcome!&lt;br /&gt;Have A Nice Day Folks!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-7397941774068362231?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/7397941774068362231/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=7397941774068362231&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/7397941774068362231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/7397941774068362231'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/07/information-on-how-to-buy-scanner.html' title='Information On How To Buy A Scanner'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-3684771877455930360</id><published>2009-07-16T09:45:00.008+05:30</published><updated>2009-08-10T09:52:07.873+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Information Is Wealth'/><title type='text'>Tips To Manage Time</title><content type='html'>Hi friends,&lt;br /&gt;&lt;br /&gt;From the past few weeks, I have seen some of my friends complaining that they don't have time. I felt that, they felt so because of their inability to manage time!&lt;br /&gt;So today,I would like to share some tips to manage time efficiently and effectively.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Write Down Your Tasks&lt;/span&gt; &lt;br /&gt; Yes my friends, that indeed in necessary. Imagine the amount of time you save, by this method as you dont have to think each time as to what all have you missed.  Not to mention what all you need to complete. It can be anything from small errands, homework assignments or paying a bill.But not doing it forces you to rush at the last minute.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Organize Your List&lt;/span&gt; &lt;br /&gt; Organize the list in which task is due. &lt;br /&gt;For example, &lt;br /&gt;Math homework: Due Tuesday, &lt;br /&gt;Water Bill: Due the 20th, &lt;br /&gt;Groceries: This Week. &lt;br /&gt;This list sorted in the order of your priority will even give information as to which work is to be done immediately and which can wait.&lt;br /&gt;&lt;br /&gt;* This method also helps you to finish jobs sooner if you select the time period of each task carefully. Select a time peroid for a task and complete it as soon as you can within the time. The sum of all the time you save is your success.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Work On Tasks One At A Time&lt;/span&gt;&lt;br /&gt; Dont do Multi-Tasking(Many works at the same time! You might end up confused!)&lt;br /&gt;Doing so will reduce your stress too!&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;We Are All Humans!&lt;/span&gt;&lt;br /&gt; What ever it may be, we are all humans! So please take some break and continue your work with new Vigour!&lt;br /&gt;&lt;br /&gt;Hope my points were useful to you! Your recommendations are welcome!&lt;br /&gt;All the Best to folks who try to implement my points!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-3684771877455930360?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/3684771877455930360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=3684771877455930360&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/3684771877455930360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/3684771877455930360'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/07/tips-to-manage-time.html' title='Tips To Manage Time'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-3728587934081109623</id><published>2009-07-13T13:21:00.005+05:30</published><updated>2009-08-10T09:56:51.322+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Good Health'/><title type='text'>Tips To Reduce Pressure</title><content type='html'>Hi friends,&lt;br /&gt;High blood pressure, also called hypertension, is a common problem and needs regular monitoring. Doctors identify high blood pressure when the Sphygmomanometer reading is 140/90 mmHg or more. This can lead to kidney failure, heart attacks and other draining health conditions. So I would like to write some points on lowering blood pressure.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Find Out What Your Reading Says:&lt;/span&gt;&lt;br /&gt;Find out the exact reading on the Sphygmomanometer by visiting a doctor at least once every month.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Make Changes In Your Diet:&lt;/span&gt;&lt;br /&gt;Get ready to make changes in your diet and lifestyle. Follow the advice of your doctor and take the prescribed medicines. &lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Avoid Tobacco:&lt;/span&gt;&lt;br /&gt;Avoid smoking or inhaling any tobacco products. Please Know that tobacco contracts your blood vessels and makes the heart beat faster resulting in the increasing of your blood pressure.&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Exercise A Lot:&lt;/span&gt;&lt;br /&gt;Exercise regularly and lose weight in case you are obese and overweight. &lt;br /&gt;&lt;br /&gt;Practice relaxation techniques such as proper breathing and meditation as these are proven stress-busters. Perform them at least once a day. &lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Stop Consuming Fatty Foods:&lt;/span&gt;&lt;br /&gt;Avoid fatty foods, especially non-vegetarian items. Eat plenty of fruits and green vegetables.  &lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Limit Your Intake Of Salt:&lt;/span&gt;&lt;br /&gt;Limit your daily sodium intake(common salt intake) as it increases blood pressure. &lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Get Feedback:&lt;/span&gt;&lt;br /&gt;Get biofeedback from certified trainers. You may contact reliable trainers who are located closer to your home.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-3728587934081109623?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/3728587934081109623/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=3728587934081109623&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/3728587934081109623'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/3728587934081109623'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/07/tips-to-reduce-pressure.html' title='Tips To Reduce Pressure'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-6012794323880560903</id><published>2009-07-10T09:30:00.004+05:30</published><updated>2009-08-10T09:52:42.998+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Information Is Wealth'/><title type='text'>Hiring A Contractor</title><content type='html'>Hiring a contractor can be similar to acquiring a brother in-law, &lt;br /&gt;except that when it comes to a contractor, you're the one who gets to do the choosing and not your little sister. This family aspect implies the fact that you'll probably be expecting quite a lot from your contractor, depending on the size of the project and you need to find out as to who'll do the job right. &lt;br /&gt;­&lt;br /&gt;In order to make a sound choice, there are several key questions you should pose to potential contractors and I will help you get those questions as follows.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Know The Business History&lt;/span&gt;&lt;br /&gt;When you're first getting into the process of hiring a contractor, you'll want to dig deep to get an idea of his or her business history. This means requesting and duly verifying proof that he or she is currently state licensed, paying employees legally and carrying worker's compensation, property damage and liability insurance. Membership with a reputable professional association is also a good sign. &lt;br /&gt;&lt;br /&gt;Also find out if the contractor's ever declared bankruptcy or if anyone's ever taken legal action against him or her. You should also find out how their business is structured and where it's physically based.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;The Supervision Of Work&lt;/span&gt;&lt;br /&gt;­It's important to ascertain during the course of the interview how the contractor plans on handling site supervision and subcontractors. For starters, a lot of the questions  concerning licensing, payroll, liability insurance and workers' comp are inquiries you'll need to put to any subcontractors as well.Everyone on-site must be covered fully. &lt;br /&gt;&lt;br /&gt;Further key questions center around work site presence. How much time does the contractor propose to spend on your project each week, and how many other jobs is he or she completing in tandem to yours? Does the contractor plan on doing any of the actual labor, or is he or she mainly performing in a supervisory role? How often will the contractor be on-site, and who'll be supervising during times when he or she isn't there?&lt;br /&gt;During the project, you'll probably want to check in once in a while to see how every thing's coming along. A trustworthy and accountable presence should be on hand at all times.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;The Schedule For Project Completion&lt;/span&gt;&lt;br /&gt;­Before you hire a contractor, you should ask them if he or she can provide you with a fixed start date and a completion date including any cleanup duties. These dates should be included in the formal written agreement, along with a timetable of the work that'll be done and a material list of everything that'll be needed. It's also smart to address how change orders will affect the project's time line in the contract. &lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Make Sure You Have Everything You Want&lt;/span&gt;&lt;br /&gt;Like the per payment lien releases we discussed on a previous page, warranties are a smart way to make sure you'll leave the table happy. In addition to these measures, it's a good general rule of thumb to hold off signing a contract until it includes everything you want and that you understand all the terms and conditions. You'll also want to keep up to date records of all payments and invoices in case a dispute needs to be settled.&lt;br /&gt;&lt;br /&gt;On a similar note, make sure the contractor guarantees he or she will complete all the necessary homework and obtain all the required approvals during the process. Without this precaution, some contractors might might cheat you and you could find yourself uncovering a huge legal mess the minute the door closes behind them.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Last, But Not The Least&lt;/span&gt;&lt;br /&gt;­Along with the other top questions you want to ask during the process of hiring a contractor, you should also request itemized price estimates from each candidate. After you receive these, it's best to examine each one carefully, paying particular attention to any that seem too high as well as too low. Estimates that fall in the shallow end of the pool can be a red flag for a hasty job that won't leave you with a quality finished product. If an estimate seems a good deal pricier than others, that could mean the other contractors were missing some core obstacle involved in completing the project and therefore didn't set a high enough estimate for a proper job.&lt;br /&gt;&lt;br /&gt;Don't sign that last check until you're completely happy with the completed project.&lt;br /&gt;&lt;br /&gt;If you've made it this far and have gotten all your signs in a row, it's possible you've found the contractor for you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-6012794323880560903?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/6012794323880560903/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=6012794323880560903&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/6012794323880560903'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/6012794323880560903'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/07/hiring-contractor.html' title='Hiring A Contractor'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-313571724437950085</id><published>2009-07-08T09:09:00.013+05:30</published><updated>2009-08-10T09:53:44.768+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Information Is Wealth'/><title type='text'>Tips for Staying on Budget</title><content type='html'>Hello friends,&lt;br /&gt;&lt;br /&gt;Its high time people started knowing how to stay in their budget.We need to learn to plan and maintain our budget.For those, who need a simple answer as to how to maintain,I hereby give some tips.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Focus on Savings&lt;/span&gt;&lt;br /&gt; You know how much money­ you have.Determine the amount of your budget that you can afford to save each month. Have it direct-deposited to your savings account, or to your mutual fund. Wherever you decide to keep your savings, make sure you put money into it every month. That savings will make a big difference for you later.­ &lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Use Cash and not Card&lt;/span&gt;&lt;br /&gt; Take out enough cash to last one week at a time. Make up your mind that the cash you have is all you get for your expenses each week. It's much easier to turn down a $60 pair of shoes by this method, than it is when you just have to swipe a credit card.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Reduce Bad Habits and Cut Them Off Soon&lt;/span&gt;&lt;br /&gt; Try to reduce smoking and drinking, and put the beer/cigarette money toward your other expenses. It's difficult! I agree,but I assure you, that You'll see your bills come down and not to mention, your health will improve too!. As you'll save on health care expenses down the road, you may become eligible for lower insurance premiums which of course is a boon.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Share the Responsibility With Your Family&lt;/span&gt;&lt;br /&gt; Make sure you're not the only member of your household concerned about your budget. If you're working hard to save money, but your spouse is out spending you into debt, you're fighting a losing battle. Sit down together and make a plan to determine how much ­spending money you should each have. Then, check in every week to see how well you're doing.If the entire family shares the responsibility for the budget, everyone can cut back just a little and make a big difference.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Keep Your Receipts To Check Yourself&lt;/span&gt;&lt;br /&gt; You probably monitored your expenses for several weeks to make a budget. Once the budget is made, though, it can be tempting to stop keeping up with every little expense. But keeping track really can help you stick to your budget. Save yo­ur receipts, and write down the places you spend money. You'll be less likely to overspend if you realize how much money has actually gone through your hands.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Analyze Your Spending In Your Budget&lt;/span&gt;&lt;br /&gt; Look through your budget and all your receipts. Can you find an expense that can be cut? Maybe you could bring your lunch to work twice a week, or set up a carpool with a friend. Just c­utting out restaurant and gas costs can help increase the amount of money you have available for savings and purchases.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Deposit Your Savings At A Bank&lt;/span&gt;&lt;br /&gt; ­If you find that you keep reaching into your savings, set up a CD(Certificates Of Deposit) or other acc­ount with early withdrawal penalties. Banks and other institutions pay more interest if you'll agree to let them use your money for a longer amount of time. Putting your savings into a yearly CD will yield more than a three-month note would.Friends from India, I would prefer you to put FDin banks /Schemes in Post Office like NSS,etc.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Be A Little Lenient With Yourself At Times&lt;/span&gt;&lt;br /&gt; Remember that life is unpredictable, and things happen that are out of our control. When­ you make a budget, try to allow some extra money for variable expenses. And, be gentle with yourself if you go over your budget sometimes. It can be hard to get back on track ­if you let yourself get too frustrated over a mistake or two.&lt;br /&gt;&lt;br /&gt;Dear friends,Follow­ing these tips can help you stick to your budget. You can prepare for a major purchase without having to borrow more than is absolutely necessary, and you can feel good about keeping your finances under control.&lt;br /&gt;&lt;br /&gt;Hope my tips were useful.I would gladly accept your comments/recommendations.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-313571724437950085?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/313571724437950085/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=313571724437950085&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/313571724437950085'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/313571724437950085'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/07/tips-for-staying-on-budget.html' title='Tips for Staying on Budget'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-8921334753312024648</id><published>2009-07-06T10:52:00.001+05:30</published><updated>2009-08-10T09:51:02.577+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Information Is Wealth'/><title type='text'>Tips For Effective PowerPoint Presentations</title><content type='html'>Hello friends,&lt;br /&gt;Taking a look at some seminars I had attended,I find them not so equipped in their PowerPoint Presentations(PPT for short), as they are.&lt;br /&gt;So, emphasizing on this I would like to present some tips on Creating Effective PowerPoint Presentations.&lt;br /&gt;&lt;br /&gt;* &lt;strong&gt;The focus should be on the presenter and on the compelling story that he has to tell&lt;/strong&gt; &lt;br /&gt; PowerPoint is most effective at providing supplementary information, like simple, colorful graphs, but should never be the main source of information.&lt;br /&gt;In short, It should not look af if a person can just read on from the screen. People hate it!&lt;br /&gt;&lt;br /&gt;* &lt;strong&gt;Use More Diagrams&lt;/strong&gt;&lt;br /&gt; Usage of more diagrams, charts, models, graphs, etc help the person to get an in depth knowledge of the presentation.Remember friends, &lt;strong&gt;Actions Speak Louder Than Words!&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;* &lt;strong&gt;Make It Look Like A Story&lt;/strong&gt; &lt;br /&gt; The goal of any presentation is to sell the audience on an idea. It could be a new technology, a plan for reconstruction of the project to make it faster. For the audience to understand the presentation, it needs to be told as a story. Presentations must explain the people as to&lt;br /&gt;•Where we are now&lt;br /&gt;•Where we want to end up&lt;br /&gt;•How are we going to get there&lt;br /&gt;&lt;br /&gt;* &lt;strong&gt;Keep It As Short As Possible&lt;/strong&gt;&lt;br /&gt; A Presentation must not be more than 20 minutes. &lt;br /&gt; If its more, then, I assure you my friends,even the most active person in the hall would feel drowsy!&lt;br /&gt;&lt;br /&gt;Hope you find it useful! Kindly share your views/information regarding the topic.&lt;br /&gt;I would appreciate it!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-8921334753312024648?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/8921334753312024648/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=8921334753312024648&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/8921334753312024648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/8921334753312024648'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/07/tips-for-effective-powerpoint.html' title='Tips For Effective PowerPoint Presentations'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-4642722714178713206</id><published>2009-07-04T10:48:00.001+05:30</published><updated>2009-08-10T09:49:32.310+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Information Is Wealth'/><title type='text'>Building A Good Reference List</title><content type='html'>Hi friends,&lt;br /&gt;&lt;br /&gt;In this period of recession, many jobs need a good reference.&lt;br /&gt;So now, In this post, I would like to emphasize on how to build a good reference list.&lt;br /&gt;&lt;br /&gt;My points, will work wonders for you, my friends!&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Make sure the people you name as references are aware of it and are comfortable speaking on your behalf.It should not come as a surprise for them.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Before you submit a reference list to a employer, provide each contact with an updated copy of your resume and describe the company and position you've applied for. &lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Consider which of your references can best discuss the qualities you possess that directly relate to the job.&lt;/span&gt; &lt;br /&gt;  &lt;br /&gt;  Such individuals won't necessarily possess the most impressive job titles,but they might be the best to discuss your details.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Tell the truth&lt;/span&gt; while you talk in your interview and also to your reference.Please remember, it will not take much time for them to analyze your information.&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Even if a reference doesn't end up speaking on your behalf, thank that person and keep him/her updated on the status of your search. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  If you are hired, be sure to send a thank-you note or even a small gift to your  references. Also remember to not to loose the relationships.&lt;br /&gt;  &lt;br /&gt;  Keeping in touch with your references, even after you've settled into a new job, can help you maintain a solid network of professionals who can assist you in various ways throughout your career.&lt;br /&gt;&lt;br /&gt;All the best Folks!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-4642722714178713206?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/4642722714178713206/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=4642722714178713206&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/4642722714178713206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/4642722714178713206'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/07/building-good-reference-list.html' title='Building A Good Reference List'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-3512062614074330526</id><published>2009-07-01T09:24:00.001+05:30</published><updated>2009-08-10T09:57:11.995+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Good Health'/><title type='text'>Information Regarding Depression</title><content type='html'>Depression is one of the disorders of our time.&lt;br /&gt;&lt;br /&gt;Many people are affected by depression in their lives due to their personal problems. Depression affects our physical body, emotions and behavior. Depression makes an individual to become sad, angry, and at times even frustrated and this makes them to take negative decisions.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;HOW DOES A PERSON KNOW IF HE/SHE IS DEPRESSED&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;* People having no hope in what they do are in state of depression.&lt;br /&gt;&lt;br /&gt;* People who think that someone has to step forward to solve their problems, instead of giving one more try are said to be depression.&lt;br /&gt;&lt;br /&gt;* People who expect too much of care without understanding what others think are the ones in depression.&lt;br /&gt;&lt;br /&gt;* People who are lazy tend to become depressed.&lt;br /&gt;&lt;br /&gt;* Finally, if you really wanted to know if you are depressed, you would not accept at least one point that I have mentioned above.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Apply it to your lives, you can easily judge yourself.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;HOW TO KEEP ONESELF WHEN DEPRESSED:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;* What ever your position may be, THINK POSITIVE! That would remove your depression with in no time. You will never encounter a word as “YOU CAN'T”&lt;br /&gt;&lt;br /&gt;* If in case you are not able to think positive, try out the following.&lt;br /&gt;&lt;br /&gt;* Its really easy my friends to stay away from depression. Keeping oneself always busy with some interesting work, will avoid depression.&lt;br /&gt;&lt;br /&gt;* Its better to be left alone at these times in case it might cause tension that might even lead to physical injury.&lt;br /&gt;&lt;br /&gt;* For people who feel depressed that no one cares about them, A good advice would be, to Pay attention to ourselves, which in turn sends the message internally, that we care about ourselves.&lt;br /&gt;&lt;br /&gt;* Meditation will help immensely to reduce the in built feelings that make you mad.&lt;br /&gt;&lt;br /&gt;* If you are a fan of any musician, better listen to his music. Nothing soothes a mind better than music. I would prefer A.R.RAHMAN's melodies.&lt;br /&gt;&lt;br /&gt;* If you're truly depressed, it's very difficult and should consult psychiatrist.&lt;br /&gt;&lt;br /&gt;* Try to read self-help books and focus on the things that you are passionate about in life&lt;br /&gt;&lt;br /&gt;* Avoid alcohol and drugs. They will only aggravate your condition.&lt;br /&gt;&lt;br /&gt;* As a last option, Share your feelings to people close to you or to a psychiatrist, so that u feel mind free and your burden will be reduced.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;EVERY ONE IS DEPRESSED AT SOME POINT TO TIME, IF THEY REALIZE WHAT TO DO, THEY SUCCEED IN LIFE!!!&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-3512062614074330526?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/3512062614074330526/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=3512062614074330526&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/3512062614074330526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/3512062614074330526'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/06/information-regarding-depression.html' title='Information Regarding Depression'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-7873295098397288407</id><published>2009-06-27T10:25:00.002+05:30</published><updated>2009-08-10T09:43:41.243+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Good Health'/><title type='text'>Benefits Of Exercise.</title><content type='html'>Hi friends,&lt;br /&gt;Considering the fact that many of the youngsters these days are more into work and studies, there is a lack in the physical exercises that they need. The cause might be the ignorance of the benefits that physical exercises provides.&lt;br /&gt;Considering the above I would prefer to share some valuable information regarding the benefits of an exercise.&lt;br /&gt;&lt;br /&gt;Regular exercises has its advantages. Significantly it  reduces body weight and rescues us from many health issues. As age increases, the required calories decreases so we must reduce the food taken in. Health studies show that exercises increases muscle mass and decreases fat tissue.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;BENEFITS : &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;* longer living&lt;br /&gt;* reduces heart disease&lt;br /&gt;* lowers high cholesterol&lt;br /&gt;* lowers hypertension&lt;br /&gt;* protects from certain cancers&lt;br /&gt;* prevents osteoporosis &lt;br /&gt;* relives from depression and anxiety&lt;br /&gt;* weight reduction &lt;br /&gt;* improves quality of life&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;HOW AND WHAT TO EXERCISE ? &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;* Aerobic workouts improve cardiovascular system.&lt;br /&gt;* Weight-training improves muscular strength.&lt;br /&gt;* Stretching exercises improve overall mobility.&lt;br /&gt;* A brisk walk for 15 to 20 minutes a day reduces risk of heart attack,premature death.&lt;br /&gt;* Aerobic exercise can improve bone strength.&lt;br /&gt;* Walking Improves Health.&lt;br /&gt;* Exercise For Weight Reduction&lt;br /&gt;* On an average of 400 calories per day is burnt in physical activity.&lt;br /&gt;* Weight-lifting.&lt;br /&gt;* Resistance band workouts.&lt;br /&gt;* Cycling.&lt;br /&gt;* Climbing stairs.&lt;br /&gt;* Pushups.&lt;br /&gt;* Strength-Training Improves Metabolic Rate.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-7873295098397288407?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/7873295098397288407/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=7873295098397288407&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/7873295098397288407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/7873295098397288407'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/06/benefits-of-exercise.html' title='Benefits Of Exercise.'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-2944771298498262163</id><published>2009-06-23T14:01:00.001+05:30</published><updated>2009-08-10T09:46:30.377+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Good Health'/><title type='text'>REDUCE FAT ,BE SAFE</title><content type='html'>Hi friends, &lt;br /&gt;&lt;br /&gt;Today I would like to give some information about reducing FAT. &lt;br /&gt;&lt;br /&gt;Fat is mainly due to presence of surplus amount of calories. It cause many health hazards .Moreover it makes people to lose their self confidence. Fat is not only because of eating habits and diets.&lt;br /&gt;&lt;br /&gt;Fat can be due to a combination of&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;gender&lt;/span&gt; &lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;age&lt;/span&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;stress&lt;/span&gt; and&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;genetic inheritance&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;People with BMI(Body Mass Index) less than 34 have a high risk to fat. Fat leads to heart disease ,high cholesterol levels, raised blood pressure, insulin resistance syndrome and high blood sugar.&lt;br /&gt;&lt;br /&gt;Food stuffs that can cause fat are mainly :&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;carbohydrate&lt;/span&gt;&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;fat&lt;/span&gt; and&lt;br /&gt;* &lt;span style="font-weight:bold;"&gt;Protein&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Stress is prone to both men and women. But it is risky to men especially. Men of any age can develop stress and leads to fat.&lt;br /&gt;&lt;br /&gt;There are many products in our market, What I prefer would be "GO TO A GOOD DOCTOR!"&lt;br /&gt;&lt;br /&gt;It's natural to take risks in one's life, but please don't take risks with your life! &lt;br /&gt;&lt;br /&gt;So please better try to avoid fat and lead a happy life. REDUCE FAT AND BETTER BE SAFE.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-2944771298498262163?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/2944771298498262163/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=2944771298498262163&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/2944771298498262163'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/2944771298498262163'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/06/reduce-fat-be-safe.html' title='REDUCE FAT ,BE SAFE'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-6224810085634978019</id><published>2009-06-12T13:40:00.001+05:30</published><updated>2009-08-10T09:54:08.311+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Information Is Wealth'/><title type='text'>Seven Easy Steps To Save On Fuel and Save Money</title><content type='html'>Hi friends,&lt;br /&gt;&lt;br /&gt;I see fuel prices rising all over the world and from what I figured out, resources are getting minimum.&lt;br /&gt;With the lack of revenue in the current world, the best option would be to save what we have got, or&lt;br /&gt;in other words use less amount of resources.Its not enough to insure our lives alone, we need to save our resources too.&lt;br /&gt;&lt;br /&gt;In such an approach, I feel some options, that could save us, from what might overcome us tomorrow.&lt;br /&gt;&lt;br /&gt;1. Usage of bicycles as much as possible.This not only reduces the resource consumption,&lt;br /&gt;   but also saves the environment from pollution, not to mention the daily exercise that U get!&lt;br /&gt;   &lt;br /&gt;2. While driving your vehicle, please stop driving like a maniac! It nearly reduces the fuel consumption  in half. This might look boring, but my folks, if you continue then you might forget to drive at all!&lt;br /&gt;   &lt;br /&gt;3. Every vehicle has its own speed limits, make sure you drive accordingly, &lt;br /&gt;   A car or truck moving at 55 mph can get about 15 percent better fuel economy &lt;br /&gt;   than the same car going 65 mph. While each vehicle reaches its optimal fuel economy&lt;br /&gt;   at a different speed (or range of speeds), fuel mileage usually decreases rapidly at &lt;br /&gt;   speeds above 60 mph. You can assume that each 5 mph you drive over 60 mph &lt;br /&gt;   is like paying an additional 24 cents per gallon for fuel.&lt;br /&gt;   &lt;br /&gt;4. Use Cruise Control Whenever Possible,It's a luxury convenience, &lt;br /&gt;   But, when used properly,like when you are driving on highways, &lt;br /&gt;   cruise control can also be a fuel saver.It smoothes out driver input,&lt;br /&gt;   helps maintain an even speed and allows the driver to take a long look &lt;br /&gt;   at the road, rather than reacting to every little change in the surrounding traffic.&lt;br /&gt;&lt;br /&gt;5.Avoid Excessive Idling.Idling uses more fuel than turning the engine off and restarting it   again. So if you are stopped for more than a minute, shut off the car. &lt;br /&gt;  Shut off your vehicle while waiting outside the elementary school to pick up your children,&lt;br /&gt;  or in public places like traffic signals where you are sure that you will wait for more than a    minute.&lt;br /&gt;  &lt;br /&gt;6.Minimise the use of AC&lt;br /&gt;  Usage of AC in your car might not consume much of the resource on a single day, but consider &lt;br /&gt;  it to be done for a month and you will get surprising figures of how much resource is going &lt;br /&gt;  down the drain!&lt;br /&gt;  &lt;br /&gt;7.Most important of all,please maintain your vehicle well! Care for it as if its your baby, and I am&lt;br /&gt;  sure that you will save a lot of money.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-6224810085634978019?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/6224810085634978019/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=6224810085634978019&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/6224810085634978019'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/6224810085634978019'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/06/seven-easy-steps-to-save-on-fuel-and.html' title='Seven Easy Steps To Save On Fuel and Save Money'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-212417673960866424</id><published>2009-06-11T09:17:00.000+05:30</published><updated>2009-06-11T09:34:02.308+05:30</updated><title type='text'>Information and Tips On How To Study For Exams</title><content type='html'>&lt;p&gt;   1. By the time someone reaches adulthood, they mostly only use the left side of their brain while studying, that's the mathematical side - where you think in black and white. Kids use the whole thing, and may be that is why they do better in their minor tests. Use both sides, its the only true reliable way. Use your imagination and think clearly.   &lt;/p&gt;&lt;p&gt;  2. Keep your study place neat and ordered. Have a folder for each subject and manage your studies well by creating a timetable for studying. Switch subjects when you feel bored.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;   3. Relax well in between your studies and recollect what you have studied so far.&lt;/p&gt;&lt;p&gt;   4. Start studying as soon as you can after school. The minute you come in the door, slam your bag on the ground, run upstairs, take a shower (if you need it), and start studying straight after.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;   5. Listen in class. Believe it or not, those who do well in any subject listen in class, even if they don't appear to be.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;   6. Pick out the important words in bold and look them up on the net or get it from the textbook and write your own definition for them. Dear friends, this helps greatly to get an insight of the subject.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;   7. For your homework, use the resources available to you like the text book and class notes. More or less rewrite it in your own words. Sounds kind of boring, but you'd be surprised by the amount of people who do badly just because they don't read the book.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;  8. Take an interest in the subject, but don't be too focused on being interested.&lt;br /&gt;&lt;/p&gt;  9.  Do not spent more than 1 hour studing without having a break because the mind gets tired and does not give attention to the subject.&lt;br /&gt;&lt;p&gt;I WOULD LIKE TO RECOMMEND THE FOLLOWING TIPS FOR STUDYING:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;    * Be positive in your thinking and action.&lt;br /&gt;    * Be optimistic and persistent.&lt;br /&gt;    * Work tough and expect the least, That will help you prepare even better.&lt;br /&gt;    * Give your best effort.&lt;br /&gt;    * Be organized.&lt;br /&gt;    * Set realistic and achievable goals.&lt;/p&gt;&lt;p&gt;    * Last but not the least, Do not slack off my friends! Be strong; if you fall, always pick yourself up, it's never too late!&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-212417673960866424?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/212417673960866424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=212417673960866424&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/212417673960866424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/212417673960866424'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/06/information-on-how-to-study-for-exams.html' title='Information and Tips On How To Study For Exams'/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1246487936314048633.post-4628496498018010976</id><published>2009-06-10T09:30:00.000+05:30</published><updated>2009-06-10T09:56:39.408+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Help In Need Is A Help Indeed'/><title type='text'></title><content type='html'>Help is not something which comes by force. It is something which comes voluntarily, something which comes from the bottom of the heart.&lt;br /&gt;&lt;br /&gt;Help a person when you can, with whatever you can, and most importantly, make him feel better with your words.&lt;br /&gt;&lt;br /&gt;Help, not necessarily needs to be monetary, A few affectionate words when needed would pay well to bring out the &lt;span style="font-weight: bold;"&gt;POSITIVE ATTITUDE&lt;/span&gt; in him.&lt;br /&gt;&lt;br /&gt;Few words like "&lt;span style="font-weight: bold;"&gt;Don't worry, I am with you!&lt;/span&gt;" would add such a positive spirit in one's work.&lt;br /&gt;&lt;br /&gt;Life is not a bed of roses my dear friends, and it might so happen that we too, might need help at some point of time, and when that time comes, we might be surprised to see the people coming forward to help us!&lt;br /&gt;&lt;br /&gt;You might be as stubborn as a rock, but as you help you will also realize as to how soft you are deep inside.&lt;br /&gt;&lt;br /&gt;Dear friends, Help As Much As You Can And Make Path To A Better Future!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1246487936314048633-4628496498018010976?l=helptotheneeded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://helptotheneeded.blogspot.com/feeds/4628496498018010976/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1246487936314048633&amp;postID=4628496498018010976&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/4628496498018010976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1246487936314048633/posts/default/4628496498018010976'/><link rel='alternate' type='text/html' href='http://helptotheneeded.blogspot.com/2009/06/helping-in-need-is-help-indeed.html' title=''/><author><name>Chandrasekar</name><uri>http://www.blogger.com/profile/05960622003014894159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_YDxv9l_TcKc/TVTElryfHFI/AAAAAAAAAJk/388InORMUMY/s220/41471_100000744828540_2754_q.jpg'/></author><thr:total>0</thr:total></entry></feed>
