Originally posted by Nitin Adlakha: I can understand that questions are not so easy for you.
Nobody said anything about the questions being easy or hard. Paul was just pointing out that this forum is not the place to come if you want your homework doing for you. If you tell us what you think the answers are and why, then people will be happy to explain any mistakes you have made, but you have to show that you've made some effort.
Precisely. The point I was trying to impress on you is if all you want is the answers you will probably find someone somewhere who will give them to you. However, the goal of this site is to point people in the right direction so they can learn how to answer questions like these themselves. So that source of easy answers is probably not here.
As Joanne says, tell us what you think the answers might be, and why, or explain which parts you are struggling to understand, and someone will be more than happy to help.
Originally posted by Nitin Adlakha: Q1.The fucntion that will compare two strings without case sensitivity?
A1. OPTIONS are : (1) string.ignoreCase(String) (2) string.equalsIgnoreCase(String) should be 2
Q2.The listener which invokes on the container & displays its state is: A2.ContainerListener? Taking a guess did not read the API properly just saw that there was an interface by this name
Q3.The exception that raises by not initializing a component in the panel is: A3. 1.array out of bounds 2.null pointer 3.arithmetic exception 2. null pointer? Taking a guess again here. This is was usually happens in Java I think if an object is not initialized.
Q4.the try block can contain no of catch blocks & they will be executed in the order is: A4. 1.sequential 2.based on exxception 3.random 2 based on the exception.
Q5.The CLASS that handles data input from the console is: A5. 1.InputStream 2.SYstem.in 3.System.out 4.OutputStream System.in - had to check API for this,
Q6.the container of the component class can be accessed thru the method: A6. 1. getContainer() 2.getComponent() 3.getContentpane() 4.getContent() Could not find these methods in the API. Found getParent() which returns the Container.
Q7. which all of the following equates to true: where s1="yes",s2="yes",s3="yes" all hving d same value; A7.1. s1==s2 2. s3==s1 3. s1.equals(s2) 4. s3.equals(s1) 3 and 4. == compares object reference. I think s1, s2 and s3 are different objects
Q8.which of the following classes are available in the java.lang package? A8.1.stack 2.object 3.math 4.random 5.string 2 and 5. Stack should probably be part of util with other collections, math is a separate package. Random is probably part of math, confirmed it is not part of lang
My answers in italics.
He who asks a question is a fool for five minutes; he who does not ask a question remains a fool forever - Chinese proverb
Joined: Aug 05, 2005
Q5 - System.in is not a class, it's a field in the System class.
Q7 - The answer is all of them. Search these forums for 'string pool'.
Q8 - The answer is none of them. Java is case sensitive.