<?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:blogger='http://schemas.google.com/blogger/2008' 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-499460786565996554</id><updated>2024-08-29T18:00:09.979+05:30</updated><category term="Video"/><category term="Puzzle"/><category term="Questions/Answers"/><category term="General"/><category term="Source code"/><category term="Quiz of the day"/><category term="Programs(Moderate)"/><category term="Programs (Easy)"/><category term="Notable"/><category term="Java tutorial"/><category term="SCJP/OCJP"/><category term="Eclipse"/><category term="Interview"/><title type='text'>Java is the future !</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://javaenthusiastic.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://javaenthusiastic.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04990026893506195372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>129</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-499460786565996554.post-5765796183054379088</id><published>2011-08-16T12:50:00.000+05:30</published><updated>2011-08-16T12:50:15.055+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Questions/Answers"/><category scheme="http://www.blogger.com/atom/ns#" term="Quiz of the day"/><title type='text'>Quiz of the day | OCPJP - Aug 16, 2011</title><summary type="text">
What will be the result of compiling and running the following code:

Options :
a) true
true
b) false
true
c) false
false
d) None of the above


Solution:&amp;nbsp;Correct choice is option B.
Creating a new instance of the class File, you&#39;re not yet making an actual file, you&#39;re just creating a filename. So file.exists() return false.
createNewFile() method created an actual file. So file.exists() </summary><link rel='replies' type='application/atom+xml' href='http://javaenthusiastic.blogspot.com/feeds/5765796183054379088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javaenthusiastic.blogspot.com/2011/08/quiz-of-day-ocpjp-aug-16-2011.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/5765796183054379088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/5765796183054379088'/><link rel='alternate' type='text/html' href='http://javaenthusiastic.blogspot.com/2011/08/quiz-of-day-ocpjp-aug-16-2011.html' title='Quiz of the day | OCPJP - Aug 16, 2011'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04990026893506195372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQtf5p2A_UZFJfXT2NF3D97QO66meVGL8wKqtETEGlaOcj24a9jzgnH3etQuh29hX0wWJhGXj3S3iw8tkW9dwa0FJ-DSMqNOCm9VEhmzLJHHj4A_lBhX_wWPdSiSyWkfJARHVwrHFjMaDB/s72-c/285205_10150277445624341_201821239340_7404051_4607052_n.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-499460786565996554.post-6893575878130190579</id><published>2011-08-16T11:59:00.001+05:30</published><updated>2011-08-16T12:00:40.059+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="General"/><title type='text'>How to become a Java developer?</title><summary type="text">
&quot;I want to be a java developer, What are the all skills that I need to have. I have learned the core java in college but what now?&quot;Does this sound a familiar question! You too may have a similar question in your mind. Don&#39;t worry, This article explains what are all the skills that you will need to be a Java web developer, and what are the skills that you are expected to have when you appear for </summary><link rel='replies' type='application/atom+xml' href='http://javaenthusiastic.blogspot.com/feeds/6893575878130190579/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javaenthusiastic.blogspot.com/2011/08/how-to-become-java-developer.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/6893575878130190579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/6893575878130190579'/><link rel='alternate' type='text/html' href='http://javaenthusiastic.blogspot.com/2011/08/how-to-become-java-developer.html' title='How to become a Java developer?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04990026893506195372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-499460786565996554.post-2202561185528191900</id><published>2011-08-16T10:23:00.000+05:30</published><updated>2011-08-16T10:23:35.806+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Puzzle"/><category scheme="http://www.blogger.com/atom/ns#" term="Questions/Answers"/><category scheme="http://www.blogger.com/atom/ns#" term="Quiz of the day"/><title type='text'>Quiz of the day | OCPJP - 16 Aug 2011</title><summary type="text">



What is the output for the above code ?

Options :
a) Compile with error - Not allowed to override the return type of a method with a subtype of the original type.
b) class A - return C
c) class B - return D
d) Runtime Exception</summary><link rel='replies' type='application/atom+xml' href='http://javaenthusiastic.blogspot.com/feeds/2202561185528191900/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javaenthusiastic.blogspot.com/2011/08/quiz-of-day-ocpjp-16-aug-2011.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/2202561185528191900'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/2202561185528191900'/><link rel='alternate' type='text/html' href='http://javaenthusiastic.blogspot.com/2011/08/quiz-of-day-ocpjp-16-aug-2011.html' title='Quiz of the day | OCPJP - 16 Aug 2011'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04990026893506195372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYFsSYK6vYTrG3TmkxD_-uJLr1plUXtXJMPpUrTd_l_0lCmY7XwlONucS252SP3VplumyGnsLQYHQPEKxyfSk1uJ0qC13VzkW71hQAYAQGt4DrZ7FNy3PzQ9aEmY-n4KvTbxBxt4DWdxBI/s72-c/294040_10150290748099341_201821239340_7528294_665489_n.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-499460786565996554.post-5708602886287525603</id><published>2011-05-14T10:23:00.000+05:30</published><updated>2011-05-14T10:23:24.674+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Questions/Answers"/><category scheme="http://www.blogger.com/atom/ns#" term="SCJP/OCJP"/><title type='text'>char a = &#39;\u000A&#39;. Why is this invalid?</title><summary type="text">
Unicode escape characters of the form &#39;\Uxxxx&#39;, where xxxx is a hexadecimal value, are processed very early in the translation process (see&amp;nbsp;JLS 3.10.4&amp;nbsp;). As a result, the special characters &#39;0A&#39; (line feed) and &#39;0D&#39; (carriage return) are interpreted literally as &quot;end of line.&quot;
For example, the expression...

char A = &#39;\u000A&#39;;...therefore becomes...

char A =;...which results in a </summary><link rel='replies' type='application/atom+xml' href='http://javaenthusiastic.blogspot.com/feeds/5708602886287525603/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javaenthusiastic.blogspot.com/2011/05/char-u000a-why-is-this-invalid.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/5708602886287525603'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/5708602886287525603'/><link rel='alternate' type='text/html' href='http://javaenthusiastic.blogspot.com/2011/05/char-u000a-why-is-this-invalid.html' title='char a = &#39;\u000A&#39;. Why is this invalid?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04990026893506195372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-499460786565996554.post-592669415054910975</id><published>2011-05-14T06:41:00.000+05:30</published><updated>2011-05-14T06:41:38.480+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Questions/Answers"/><category scheme="http://www.blogger.com/atom/ns#" term="SCJP/OCJP"/><title type='text'>Is it allowed to declare the main method private?</title><summary type="text">
Former JVM versions (pre-1.4) allowed the main method to have any accessibility (private, etc). This incompatibility with Section 12.1.4 of the Java Language Specification has been fixed as of version 1.4. In order to invoke a main method from the command-line, it is now mandatory to declare the main method as follows:

public static void main (String[] args)If the main method has any access </summary><link rel='replies' type='application/atom+xml' href='http://javaenthusiastic.blogspot.com/feeds/592669415054910975/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javaenthusiastic.blogspot.com/2011/05/is-it-allowed-to-declare-main-method.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/592669415054910975'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/592669415054910975'/><link rel='alternate' type='text/html' href='http://javaenthusiastic.blogspot.com/2011/05/is-it-allowed-to-declare-main-method.html' title='Is it allowed to declare the main method private?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04990026893506195372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-499460786565996554.post-6788548189055000406</id><published>2011-04-24T13:47:00.001+05:30</published><updated>2011-04-24T13:52:52.166+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Questions/Answers"/><category scheme="http://www.blogger.com/atom/ns#" term="SCJP/OCJP"/><title type='text'>What are some potential trips/traps in the SCJP exam?</title><summary type="text">
Two top-level public classes cannot be in the same source file.
main()&amp;nbsp;cannot call an instance (non-static) method.
Methods can have the same name as the constructor(s).
Watch for thread initiation with classes that don&#39;t have a run() method.
Local classes cannot access non-final variables.
Case statements must have values within permissible range.
Watch for Math class being an option for </summary><link rel='replies' type='application/atom+xml' href='http://javaenthusiastic.blogspot.com/feeds/6788548189055000406/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javaenthusiastic.blogspot.com/2011/04/what-are-some-potential-tripstraps-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/6788548189055000406'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/6788548189055000406'/><link rel='alternate' type='text/html' href='http://javaenthusiastic.blogspot.com/2011/04/what-are-some-potential-tripstraps-in.html' title='What are some potential trips/traps in the SCJP exam?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04990026893506195372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-499460786565996554.post-6403598511729350095</id><published>2011-04-24T13:27:00.002+05:30</published><updated>2011-04-24T13:29:56.347+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Questions/Answers"/><title type='text'>What&#39;s up with integers not being equal to one another? The following code prints &quot;true, true, false, true&quot;. Shouldn&#39;t it be &quot;true, true, true, true&quot;?</title><summary type="text">


The key to understanding this is that the JVM uses a process called &quot;boxing&quot; (or &quot;auto-boxing&quot;) when converting an int (like 127) to an Integer object. This involves calling the Integer.valueOf(127) method. The JavaDoc:java.lang.Integer#valueOf(int) says: &quot;Returns a Integer instance representing the specified int value. If a new Integer instance is not required, this method should generally be</summary><link rel='replies' type='application/atom+xml' href='http://javaenthusiastic.blogspot.com/feeds/6403598511729350095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javaenthusiastic.blogspot.com/2011/04/whats-up-with-integers-not-being-equal.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/6403598511729350095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/6403598511729350095'/><link rel='alternate' type='text/html' href='http://javaenthusiastic.blogspot.com/2011/04/whats-up-with-integers-not-being-equal.html' title='What&#39;s up with integers not being equal to one another? The following code prints &quot;true, true, false, true&quot;. Shouldn&#39;t it be &quot;true, true, true, true&quot;?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04990026893506195372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-499460786565996554.post-3118102950964209649</id><published>2011-04-24T11:48:00.002+05:30</published><updated>2011-04-24T11:50:44.929+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="General"/><category scheme="http://www.blogger.com/atom/ns#" term="Programs(Moderate)"/><category scheme="http://www.blogger.com/atom/ns#" term="Questions/Answers"/><title type='text'>How to convert a String array to ArrayList?</title><summary type="text">1. 



2. 



3. 





Note: In the solution no 1 Arrays.asList() is efficient because it doesn&#39;t need to copy the content of the array. This method returns a List that is a &quot;view&quot; onto the array - a wrapper that makes the array look like a list. When you change an element in the list, the element in the original array is also changed. Note that the list is fixed size - if you try to add elements</summary><link rel='replies' type='application/atom+xml' href='http://javaenthusiastic.blogspot.com/feeds/3118102950964209649/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javaenthusiastic.blogspot.com/2011/04/how-to-convert-string-array-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/3118102950964209649'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/3118102950964209649'/><link rel='alternate' type='text/html' href='http://javaenthusiastic.blogspot.com/2011/04/how-to-convert-string-array-to.html' title='How to convert a String array to ArrayList?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04990026893506195372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-499460786565996554.post-3552084341141124712</id><published>2011-04-24T01:18:00.003+05:30</published><updated>2011-04-24T01:18:55.191+05:30</updated><title type='text'>Difference between Class reference and Interface reference</title><summary type="text">Interface provides the base for the concrete classes. It defines the contract which must be full filled by the implementing classes. So it can be use full in case where you need polymorphism. for example if you have some classes and interface like:







Here if you want to do some generic work which is common for both the doctors (doCheckUp) you should use the interface like






In this case </summary><link rel='replies' type='application/atom+xml' href='http://javaenthusiastic.blogspot.com/feeds/3552084341141124712/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javaenthusiastic.blogspot.com/2011/04/difference-between-class-reference-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/3552084341141124712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/3552084341141124712'/><link rel='alternate' type='text/html' href='http://javaenthusiastic.blogspot.com/2011/04/difference-between-class-reference-and.html' title='Difference between Class reference and Interface reference'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04990026893506195372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-499460786565996554.post-6979959436679978607</id><published>2011-01-30T18:58:00.002+05:30</published><updated>2011-01-30T19:00:36.386+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="General"/><title type='text'>Top 10 errors java programmers make</title><summary type="text">
Whether you program regularly in Java, and know it like the back of your hand, or whether you&#39;re new to the language or a casual programmer, you&#39;ll make mistakes. It&#39;s natural, it&#39;s human, and guess what? You&#39;ll more than likely make the same mistakes that others do, over and over again. Here&#39;s my top ten list of errors that we all seem to make at one time or another,&amp;nbsp; how to spot them, and</summary><link rel='replies' type='application/atom+xml' href='http://javaenthusiastic.blogspot.com/feeds/6979959436679978607/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javaenthusiastic.blogspot.com/2011/01/top-10-errors-java-programmers-make.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/6979959436679978607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/6979959436679978607'/><link rel='alternate' type='text/html' href='http://javaenthusiastic.blogspot.com/2011/01/top-10-errors-java-programmers-make.html' title='Top 10 errors java programmers make'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04990026893506195372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-499460786565996554.post-7567126702508742669</id><published>2010-12-05T13:20:00.002+05:30</published><updated>2011-08-17T00:56:49.324+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="General"/><category scheme="http://www.blogger.com/atom/ns#" term="SCJP/OCJP"/><title type='text'>Top 5 reasons that make SCJP Certification Exam tough</title><summary type="text">1.You are not in reality of the exam preparation
Most of the time preparation for this certification exam is approached in the conventional style especially the way you did preparation back in school and college days. However the reality of this exam is that you are no longer in school or in college (some exceptions maybe there) you are in a full time job and you have to manage job </summary><link rel='replies' type='application/atom+xml' href='http://javaenthusiastic.blogspot.com/feeds/7567126702508742669/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/12/top-5-reasons-that-make-scjp.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/7567126702508742669'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/7567126702508742669'/><link rel='alternate' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/12/top-5-reasons-that-make-scjp.html' title='Top 5 reasons that make SCJP Certification Exam tough'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04990026893506195372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-499460786565996554.post-1356058938059645225</id><published>2010-12-03T07:20:00.003+05:30</published><updated>2010-12-03T07:32:56.044+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Quiz of the day"/><title type='text'>Quiz of the Day | December 3, 2010</title><summary type="text">What will be the output when you compile and execute the following program?&amp;nbsp;
Choose one answer.&amp;nbsp;
a. Prints true&amp;nbsp;
b. Prints false&amp;nbsp;
c. Prints 9&amp;nbsp;
d. Prints 2&amp;nbsp;
e. Compiler error : Incorrect declaration of main method&amp;nbsp;
f. None of these


Solution :&amp;nbsp;Choice F is the correct answer.&amp;nbsp;

The code does not compile because the &amp;amp;&amp;amp; operator works only with </summary><link rel='replies' type='application/atom+xml' href='http://javaenthusiastic.blogspot.com/feeds/1356058938059645225/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/12/quiz-of-day-december-3-2010.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/1356058938059645225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/1356058938059645225'/><link rel='alternate' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/12/quiz-of-day-december-3-2010.html' title='Quiz of the Day | December 3, 2010'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04990026893506195372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEim9uVUe6S0nGYFr1RwiewsB8_HDtCDUo-qUiRNt7s0Ro1lqtYMrprsOBO78qHJCR99PADE6sc1oROiLeRvTE__IvUVD23TcTFvPwkwALNDcbmi4YhBDgxgNmHyfXx4zGOpmEbfAltF1mmr/s72-c/149865_471698719340_201821239340_5412654_5594718_n.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-499460786565996554.post-5283756087227152259</id><published>2010-11-22T06:29:00.004+05:30</published><updated>2010-11-22T06:42:34.106+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Programs(Moderate)"/><category scheme="http://www.blogger.com/atom/ns#" term="Source code"/><title type='text'>How to obtain from where a Class is loaded</title><summary type="text">


Source : &quot;rgagnon.com&quot;</summary><link rel='replies' type='application/atom+xml' href='http://javaenthusiastic.blogspot.com/feeds/5283756087227152259/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/11/how-to-obtain-from-where-class-is.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/5283756087227152259'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/5283756087227152259'/><link rel='alternate' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/11/how-to-obtain-from-where-class-is.html' title='How to obtain from where a Class is loaded'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04990026893506195372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-499460786565996554.post-3307533700117270408</id><published>2010-11-07T03:22:00.003+05:30</published><updated>2010-12-03T07:29:11.832+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Puzzle"/><category scheme="http://www.blogger.com/atom/ns#" term="Questions/Answers"/><category scheme="http://www.blogger.com/atom/ns#" term="Quiz of the day"/><title type='text'>Quiz of the Day | November 7, 2010</title><summary type="text">

What will happen when you attempt to compile and run the above code? (Assume that the code is compiled and run with assertions enabled.)

a. It will print odd and even numbers from 0 to 9 correctly (0 even and 1 odd).&amp;nbsp;
b. It will print odd and even numbers from 0 to 9 incorrectly (0 odd and 1 even).&amp;nbsp;
c. Compilation error at line 9.&amp;nbsp;
d. Compilation error at line 10.&amp;nbsp;
e. It </summary><link rel='replies' type='application/atom+xml' href='http://javaenthusiastic.blogspot.com/feeds/3307533700117270408/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/11/quiz-of-day-november-7-2010.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/3307533700117270408'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/3307533700117270408'/><link rel='alternate' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/11/quiz-of-day-november-7-2010.html' title='Quiz of the Day | November 7, 2010'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04990026893506195372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAPEPWu_UfP6WQE-8IPF_Prb8-Elj7yqZ05VPmib9Jta6N8JVl9OXA3V6NTMIrUu_IhN1Fa_gGvD98z1Cxi5oROZxi2qkAksdzVg3TpcIBpsyr_CX-CjWyMrHBZ6JnIb7Fw4lC6q3oyt86/s72-c/7.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-499460786565996554.post-327490947004796610</id><published>2010-11-06T13:02:00.003+05:30</published><updated>2010-11-06T16:09:47.111+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="General"/><category scheme="http://www.blogger.com/atom/ns#" term="Questions/Answers"/><title type='text'>Converting a 2d array of ints to char and string in Java</title><summary type="text">Question :&amp;nbsp;How can i convert the ints in a 2d array into chars, and strings?

If i copy ints to a char array i just get the ascii code.For examplepublic int a[5][5]//some codepublic String b[5][5] = public int a[5][5]Answer :&amp;nbsp;Quite frankly, the easiest approach would simply leave your array as-is... and convert&amp;nbsp;int&amp;nbsp;values toString&#39;s when you use them:
Integer.toString(a[5][5])</summary><link rel='replies' type='application/atom+xml' href='http://javaenthusiastic.blogspot.com/feeds/327490947004796610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/11/converting-2d-array-of-ints-to-char-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/327490947004796610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/327490947004796610'/><link rel='alternate' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/11/converting-2d-array-of-ints-to-char-and.html' title='Converting a 2d array of ints to char and string in Java'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04990026893506195372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-499460786565996554.post-1512898294376051598</id><published>2010-11-06T01:20:00.006+05:30</published><updated>2010-12-03T07:29:49.959+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Puzzle"/><category scheme="http://www.blogger.com/atom/ns#" term="Questions/Answers"/><category scheme="http://www.blogger.com/atom/ns#" term="Quiz of the day"/><title type='text'>Quiz of the Day | November 6, 2010</title><summary type="text">What value is printed out by executing the above code?

a. 2.7&amp;nbsp;
b. 1.7&amp;nbsp;
c. 0.0&amp;nbsp;
d. -1.0


Solution :&amp;nbsp;Choice A is the correct answer.

In Java, all parameters are passed by value. In case of primitives, the copy of the variable is passed, while in case of object references,&amp;nbsp;it&#39;s the copy of the reference that is passed.&amp;nbsp;

When the argument is a&amp;nbsp;primitive type, </summary><link rel='replies' type='application/atom+xml' href='http://javaenthusiastic.blogspot.com/feeds/1512898294376051598/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/11/quiz-of-day-november-6-2010.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/1512898294376051598'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/1512898294376051598'/><link rel='alternate' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/11/quiz-of-day-november-6-2010.html' title='Quiz of the Day | November 6, 2010'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04990026893506195372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEip-IAl0cKujwRZCybhcvj8u4Y1kvPKULJI-5QYBrDrz6FhCUEl42zx-ILRIGLO8GfDzjLoMv5IaHRU_yHtesyPr-dG1qCqVkohnVKKySqsKHnO4ypzKV_P4RzxLOOD3HpjjPA83Z2jBU81/s72-c/6.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-499460786565996554.post-8485872386473908529</id><published>2010-11-05T17:03:00.003+05:30</published><updated>2010-11-22T06:45:13.004+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Puzzle"/><category scheme="http://www.blogger.com/atom/ns#" term="Questions/Answers"/><category scheme="http://www.blogger.com/atom/ns#" term="Quiz of the day"/><title type='text'>Quiz of the Day | November 5, 2010 [2]</title><summary type="text">What will be printed on standard output if the following class is executed using the command &quot;java Test 1 two 3&quot; ?

a. 1&amp;nbsp;
b. two&amp;nbsp;
c. NumberFormatException&amp;nbsp;
d. ArrayIndexOutOfBoundsException&amp;nbsp;
e. Code does not compile


Solution :&amp;nbsp;Choice C is the correct answer.&amp;nbsp;

In Java, command line arguments are stored in the args array which is an argument to the main method. The </summary><link rel='replies' type='application/atom+xml' href='http://javaenthusiastic.blogspot.com/feeds/8485872386473908529/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/11/quiz-of-day-november-5-2010-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/8485872386473908529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/8485872386473908529'/><link rel='alternate' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/11/quiz-of-day-november-5-2010-2.html' title='Quiz of the Day | November 5, 2010 [2]'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04990026893506195372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia__O8423t1Zg03VWmhTGxVWDaoSTCGymDjPzKTgZoYph7KiISoyDloCgc9_XTxllt0eWat1DyK-giizxgnnTX3Ng6edCyJD3TJWfuK-ZUjLTQOYlZpaOfdIXv7vmCD1D5vu_PpU7RlC-I/s72-c/6.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-499460786565996554.post-8730147578597676729</id><published>2010-11-05T16:54:00.005+05:30</published><updated>2010-11-22T06:45:17.458+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Puzzle"/><category scheme="http://www.blogger.com/atom/ns#" term="Questions/Answers"/><category scheme="http://www.blogger.com/atom/ns#" term="Quiz of the day"/><title type='text'>Quiz of the Day | November 5, 2010</title><summary type="text">What will be the result of compiling the following programs and executing it using the following command - java Child?


a. Prints 9
 b. Compiler error at line 5
c. Compiler error at line 6
d. None of the above


Solution :&amp;nbsp;&amp;nbsp;Choice C is the correct answer.


You cannot access the protected variable in the Parent class from the Child class using the parent class reference. The Child </summary><link rel='replies' type='application/atom+xml' href='http://javaenthusiastic.blogspot.com/feeds/8730147578597676729/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/11/quiz-of-day-november-5-2010.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/8730147578597676729'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/8730147578597676729'/><link rel='alternate' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/11/quiz-of-day-november-5-2010.html' title='Quiz of the Day | November 5, 2010'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04990026893506195372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfeh_kBRkpW4YgNtZGwyGoky_X_wT8dltljzN5mLhpyJpo4OJJsPPBBntQD_pdCYltZG-8wISp6OVJ8pnhNfFnD14GMlwSpoK8ibjKURcB0umsA2tChIVHSKYcOdkYDLR3vUo82f7CCTrr/s72-c/5+(1).jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-499460786565996554.post-628109377980424524</id><published>2010-11-04T01:54:00.003+05:30</published><updated>2010-11-22T06:45:24.618+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Puzzle"/><category scheme="http://www.blogger.com/atom/ns#" term="Questions/Answers"/><category scheme="http://www.blogger.com/atom/ns#" term="Quiz of the day"/><title type='text'>Quiz of the Day | November 4, 2010</title><summary type="text">Given the code below, which access modifiers (public, protected, or private) can legally be placed before the myMethod() method on line 3, if no other changes are made to the code? If line 3 is left as it is, which keywords can legally be placed before the myMethod method on line 8?

a. private or nothing (default) on line 3. Nothing (default) or protected or public on line 8.&amp;nbsp;
b. public or </summary><link rel='replies' type='application/atom+xml' href='http://javaenthusiastic.blogspot.com/feeds/628109377980424524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/11/quiz-of-day-november-4-2010.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/628109377980424524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/628109377980424524'/><link rel='alternate' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/11/quiz-of-day-november-4-2010.html' title='Quiz of the Day | November 4, 2010'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04990026893506195372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKHp_s6LnEZD95fUpuwQxoirP_y1-1gvoU7Cgp2e6ygXNjZ66Lz8dGHG5UeGlPPL4DemvRfXWETIFcnYCnNa9fSO5tCPbUppt0kLL26vcZXtE6Gx-Fl_qHFBVIusC4hv1KF48eDLZGS6tj/s72-c/4.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-499460786565996554.post-741283919236685811</id><published>2010-11-03T10:04:00.005+05:30</published><updated>2010-11-22T06:45:32.354+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Puzzle"/><category scheme="http://www.blogger.com/atom/ns#" term="Questions/Answers"/><category scheme="http://www.blogger.com/atom/ns#" term="Quiz of the day"/><title type='text'>Quiz of the Day | November 3, 2010</title><summary type="text">
What will be the result of running the following code?&amp;nbsp;
a.) The output: Value is - Hello
b.) The output: Value is - Hello world
c.) A compiler error
d.) No output
e.) An exception


Solution :&amp;nbsp;Choice B is the correct answer.

Since the OR operator used here is not the short-circuit operator (which is &quot;||&quot;), both operands are evaluated even though the first operanditself is true which </summary><link rel='replies' type='application/atom+xml' href='http://javaenthusiastic.blogspot.com/feeds/741283919236685811/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/11/quiz-of-day-november-3-2010.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/741283919236685811'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/741283919236685811'/><link rel='alternate' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/11/quiz-of-day-november-3-2010.html' title='Quiz of the Day | November 3, 2010'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04990026893506195372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFtN8Srzz4HlhSVRRJLFMymAoOV1EAsov1ot1oFYjVW2zFK79Lz0HSD7lV0nTX5wmDTQXmIeYfUAjFtqIWJ5Lz-sPuo7MkNKGlHqZZbKzyRzJDFgYdPgbhA0TLiGCmW5agqrnvJCoL3LDX/s72-c/3.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-499460786565996554.post-8490605657870365724</id><published>2010-11-03T09:59:00.002+05:30</published><updated>2010-11-22T06:45:39.596+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Puzzle"/><category scheme="http://www.blogger.com/atom/ns#" term="Questions/Answers"/><category scheme="http://www.blogger.com/atom/ns#" term="Quiz of the day"/><title type='text'>Quiz of the Day | November 2, 2010</title><summary type="text">
What will happen when we try to compile the following code?


a. The compiler objects to line 3 comparing an Object with an array.&amp;nbsp;
b. The compiler objects to line 5 casting an Object to an array of int primitives.&amp;nbsp;
c. The compiler objects to line 11 comparing an Object to an array of Objects.&amp;nbsp;
d. It compiles without error.


Solution :&amp;nbsp;Choice D is the correct answer.&amp;nbsp;

</summary><link rel='replies' type='application/atom+xml' href='http://javaenthusiastic.blogspot.com/feeds/8490605657870365724/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/11/quiz-of-day-november-2-2010.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/8490605657870365724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/8490605657870365724'/><link rel='alternate' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/11/quiz-of-day-november-2-2010.html' title='Quiz of the Day | November 2, 2010'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04990026893506195372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvJi1IcPXxPRDHrffxdn4q3aayVX9FikGE9LLb8Cn94-AMUU1VIwbN5jLFqqSbfQ6lSdrSCkZw8CT5CiKSERkPEsqEbJGVxQf_ITumdHTfpShY6jofaw69zY8xTWhkVqzgmzLGRIqB-7OL/s72-c/2.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-499460786565996554.post-8711549199743191369</id><published>2010-11-01T02:06:00.001+05:30</published><updated>2010-11-22T06:45:44.957+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Puzzle"/><category scheme="http://www.blogger.com/atom/ns#" term="Questions/Answers"/><category scheme="http://www.blogger.com/atom/ns#" term="Quiz of the day"/><title type='text'>Quiz of the Day | November 1, 2010</title><summary type="text">
Which of the following statements about the following code fragment are true?

a.) The code compiles successfully and displays &quot;Test&quot;.
b.) Changing the code at line 13 to &quot;public void print(int x)&quot; will allow the code to compile correctly.
c.) The code fails to compile. The compiler complains about duplicate methods.
d.) Changing the return type on line 13 from &#39;void&#39; to &#39;int&#39; will allow the </summary><link rel='replies' type='application/atom+xml' href='http://javaenthusiastic.blogspot.com/feeds/8711549199743191369/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/11/quiz-of-day-november-1-2010.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/8711549199743191369'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/8711549199743191369'/><link rel='alternate' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/11/quiz-of-day-november-1-2010.html' title='Quiz of the Day | November 1, 2010'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04990026893506195372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgV56N97teUL35CNlz9mnqedDoKrUID7F-d_inc3mpnoX12XzpCmAP_VhYsXTRz9emHLcpbxrJbLfC0SOyNcO9lrbkN4724b7hZVvqW8P2xh335JPne8AeFPMIfJNQZs0PFodORbMSwGcLZ/s72-c/1.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-499460786565996554.post-6291169218406559014</id><published>2010-10-31T02:03:00.001+05:30</published><updated>2010-11-22T06:45:50.148+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Puzzle"/><category scheme="http://www.blogger.com/atom/ns#" term="Questions/Answers"/><category scheme="http://www.blogger.com/atom/ns#" term="Quiz of the day"/><title type='text'>Quiz of the Day | Oct 31, 2010</title><summary type="text">

How many objects will be eligible for garbage collection after the execution of line 9 in the following code?
a.) 8
b.) 14
c.) 15
d.) 16


Solution :&amp;nbsp;This code creates 16 objects of type Double. Out of which, 15 Double objects are created by the iterations of the nested for loops at lines 6 and 7, and one more Double object is created at line 5. The very first iteration of the loop makes </summary><link rel='replies' type='application/atom+xml' href='http://javaenthusiastic.blogspot.com/feeds/6291169218406559014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/10/quiz-of-day-oct-31-2010.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/6291169218406559014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/6291169218406559014'/><link rel='alternate' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/10/quiz-of-day-oct-31-2010.html' title='Quiz of the Day | Oct 31, 2010'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04990026893506195372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiScDC0C574yDM64zVCbHY92UELSED5UqTxSsNgkA2WYfOmjR0OZrpzCmUUCkDRgjUlzIrOh4qewU4PBfV6RhNe03gO3sYkoYmYbo0mU-iKEzo2M1ccapMwsQv6qo_T41XygB9V4uoMBDbl/s72-c/14645_206392044340_201821239340_2875760_6274579_n.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-499460786565996554.post-3053114154531349712</id><published>2010-10-30T19:37:00.003+05:30</published><updated>2010-11-22T06:45:55.954+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Puzzle"/><category scheme="http://www.blogger.com/atom/ns#" term="Questions/Answers"/><category scheme="http://www.blogger.com/atom/ns#" term="Quiz of the day"/><title type='text'>Quiz of the Day | Oct 30, 2010</title><summary type="text">Which of the following statements are true about the relationships between the following classes?
a.) A Bar is a Baz
b.) A Foo has a Bar
c.) A Baz is a Foo&amp;nbsp;
d.) A Foo is a Baz
e.) A Baz has a Bar


Solution :&amp;nbsp;Choices B, C, and E are the correct answers. An instance of the Baz class is also an instance of the class Foo since the Baz class extends the Foo class. So choice C is correct.&amp;</summary><link rel='replies' type='application/atom+xml' href='http://javaenthusiastic.blogspot.com/feeds/3053114154531349712/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/10/quiz-of-day-oct-30-2010.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/3053114154531349712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/3053114154531349712'/><link rel='alternate' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/10/quiz-of-day-oct-30-2010.html' title='Quiz of the Day | Oct 30, 2010'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04990026893506195372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLM0TgNJbA3gOuwiLA0wkyO6bgjTjTWbd4Ya6w0PqYbFlXUpCaVgp9o56St9bqOo99FfXTwLEABWSwYZCO7cpDJlfWs-B3TafBVBNaZ7P39fWayJhtDXjhvpyYiR9mLWzSgLCrBqhd_8oj/s72-c/14645_204779474340_201821239340_2870631_4663381_n.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-499460786565996554.post-3883479567614208729</id><published>2010-10-29T18:11:00.006+05:30</published><updated>2010-11-22T06:46:02.432+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Puzzle"/><category scheme="http://www.blogger.com/atom/ns#" term="Questions/Answers"/><category scheme="http://www.blogger.com/atom/ns#" term="Quiz of the day"/><title type='text'>Quiz of the Day | Oct 29, 2010</title><summary type="text">Which of the following statements are true?

a. As soon as the reference count for an object reaches zero, it will be immediately garbage collected.
b. The finalize() method will not be invoked more than once by the JVM on the same object.
c. The finalize() method cannot be overloaded.
d. The garbage collection implementation is JVM-dependent.
e. If the finalize() method is overridden, a call to </summary><link rel='replies' type='application/atom+xml' href='http://javaenthusiastic.blogspot.com/feeds/3883479567614208729/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/10/quiz-of-day-scjp-6-oct-29-2010.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/3883479567614208729'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/499460786565996554/posts/default/3883479567614208729'/><link rel='alternate' type='text/html' href='http://javaenthusiastic.blogspot.com/2010/10/quiz-of-day-scjp-6-oct-29-2010.html' title='Quiz of the Day | Oct 29, 2010'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04990026893506195372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>