brent spearios

Ranch Hand
+ Follow
since Apr 10, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by brent spearios

Please check Subject:String class vinita Kh 12 May 03, 2002 01:58 AM
post, Read the last subject
I passed with 91% thanks to all but many thanks to Corey, helped me out alot. See you all the next time i start the revision for another cert.
22 years ago
I took my exam yesterday and this question was in it, could the moderators please remove this post asap.
use obj.toString.equals(obj.toString);
String buffer does not override the equals method so all it does is a ==
This is a really stupid question but here goes....
I have my exam tomorrow and was wondering if they will supply me with a pen and some paper of do i have to take some myself. ( btw i live in the uk)
Thank you in advance for answering this stupid question
[ May 01, 2002: Message edited by: brent spearios ]
works fine in JDK 1.1 through 1.3 that I tested. *Nothing* needs to be public after
all in any JDK below 1.3!
Its another of javas many bugs
There is no problem with the last question, it runs fine
It only complains if the first public file isnt the same as the file name ie test.java of eg.
If its the same as the file name then the second public declaration is flagged with a compiler error
Ok ,lets start at the begining.
As String is a final class it cannot be subclassed and as a result the object must be of type string
The compare to method returns a positive or negative value if it is not valued to be true.
So if you do "test".compareTo("t"); it will return a positive number if it were "t".compareTo("test"); it will return a negative number if they are the same then it returns 0. I remeber it by substituting compareTo with a - so test-t=est thats postive and t-test=-est is negative if you know what i mean,
indexOf returns a -1 when it has not found the value in () so -1 is return.
Try running this bit of code it will help:
char t='t';//value of t as an int is 116
System.out.println((int)t);
System.out.println ("erty".indexOf (116));
hope this helps
Note that answer 2 does not create a new thread object and as such only defines a class that implements runnable, its like saying new Thread().start(); compared to new RunnableClass().start();
it just wouldnt compile.
Thanks. I'm now at the point when i will be taking my exam ( hopefully) within the next couple of days. I feel that I've covered everything but there are still some questions that catch me off guard. All i need now is just to go through my notes i have taken.
Just wondering, in your opinion, what are the objectives that you, yourself, and others have had problems with when taking the exam?
I've just done a mock test and one of the questions was if main can be native, it says it can. I thought because native methods cant have bodies that this would rule out main.
Garbadge collection isnt applicable for string literals, they are just returned to the pool.