aspose file tools*
The moose likes Beginning Java and the fly likes QUIZ 001.Questions related to core java? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "QUIZ 001.Questions related to core java?" Watch "QUIZ 001.Questions related to core java?" New topic
Author

QUIZ 001.Questions related to core java?

Nitish Agrawal
Greenhorn

Joined: Feb 11, 2008
Posts: 21
Q1.The fucntion that will compare two strings without case sensitivity?

A1. OPTIONS are : (1) string.ignoreCase(String)
(2) string.equalsIgnoreCase(String)

Q2.The listener which invokes on the container & displays its state is:
A2.

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

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

Q5.The CLASS that handles data input from the console is:
A5. 1.InputStream
2.SYstem.in
3.System.out
4.OutputStream

Q6.the container of the component class can be accessed thru the method:
A6. 1. getContainer()
2.getComponent()
3.getContentpane()
4.getContent()

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)

Q8.which of the following classes are available in the java.lang package?
A8.1.stack
2.object
3.math
4.random
5.string
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

I think you would benefit reading this and this.
[ July 21, 2008: Message edited by: Paul Sturrock ]

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Nitish Agrawal
Greenhorn

Joined: Feb 11, 2008
Posts: 21
If you guys dont know the answers then its ok,
no need to giv me any links.
I can understand that questions are not so easy for you.
well thanks for your suggestions.
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3446
    
  12
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.


Joanne
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

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.
Shikhar Madhok
Ranch Hand

Joined: Dec 18, 2006
Posts: 95
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.

Shikhar


He who asks a question is a fool for five minutes; he who does not ask a question remains a fool forever - Chinese proverb
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3446
    
  12
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.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38340
    
  23
We have already looked at case sensitivity with toUppercase and toUpperCase, but you can find a list of the classes in the java.lang package from the API documentation, probably here.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: QUIZ 001.Questions related to core java?