Dilshad Syed

Greenhorn
+ Follow
since Mar 05, 2001
Merit badge: grant badges
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Dilshad Syed

Does anyone know a way to instantiate a class based on a classname in a String?
Thanks,
Dilshad
21 years ago
Thanks for your wishes Kamilla!
I work as a programmer currently. My knowledge of JavaScript and C helped me with the basic language constructs. I put in several hours in the last 3 weeks and at times got the feeling that 3-4 weeks would not be enough. Anyway, I had to take the exam because of certain reasons and I am glad to have done well.
I think the exam really tests one's knowledge on many basic things. Here's a checklist that helped me:
Two public classes in the same file.
Main method calling a non-static method.
Methods with the same name as the constructor(s).
Thread initiation with classes that dont have a run() method.
Local inner classes trying to access non-final vars.
Case statements with values out of permissible range.
Math class being an option for immutable classes !!
instanceOf is not same as instanceof
Private constructors
An assignment statement which looks like a comparison if ( a=true)...
System.exit() in try-catch-finally blocks.
Uninitialized variable references with no path of proper initialization.
Order of try-catch-finally blocks matters.
main() can be declared final.
-0.0 == 0.0 is true.
A class without abstract methods can still be declared abstract.
RandomAccessFile descends from Object and implements DataInput and DataOutput.
Map doesnot implement Collection.
Dictionary is a class, not an interface.
Collection is an Interface where as Collections is a helper class.
Class declarations can come in any order ( derived first, base next etc. ).
Forward references to variables gives compiler error.
Multi dimensional arrays can be sparce ie., if you imagine the array as a matrix, every row need not have the same number of columns.
Arrays, whether local or class-level, are always initialized,
Strings are initialized to null, not empty string.
An empty string is NOT the same as a null string.
A declaration cannot be labelled.
continue must be in a loop( for, do , while ). It cannot appear in case constructs.
Primitive array types can never be assigned to each other, eventhough the primitives themselves can be assigned. ie., ArrayofLongPrimitives = ArrayofIntegerPrimitives gives compiler error eventhough longvar = intvar is perfectly valid.
A constructor can throw any exception.
Initilializer blocks are executed in the order of declaration.
Instance initializer(s) gets executed ONLY IF the objects are constructed.
All comparisons involving NaN and a non-Nan would always result false.
Default type of a numeric literal with a decimal point is double.
integer (and long ) operations / and % can throw ArithmeticException while float / and % will never, even in case of division by zero.
== gives compiler error if the operands are cast-incompatible.
You can never cast objects of sibling classes( sharing the same parent ), even with an explicit cast.
.equals returns false if the object types are different. It does not raise a compiler error.
No inner class can have a static member.
File class has NO methods to deal with the contents of the file.
InputStream and OutputStream are abstract classes, while DataInput and DataOutput are interfaces.
Good luck!
Hello folks,
Here are some useful resources:
1. http://www.geocities.com/SiliconValley/Orchard/9362/java/javacert/Desboro.htm
2. http://www.absolutejava.com/articles/java-tidbits.html
3. http://www.angelfire.com/or/abhilash/Main.html
(Get the answer explanations from the author.)
4. Maha's discussions on JavaRanch off http://www.javaranch.com/maha/Discussions/discussions.html
Maha's discussions are very good and can help clear one's Java fundamentals. Here are some areas where I saw some tough questions:
1. Inner classes
2. Threads(know the wait(), notify() and the repercussions of calling them well.
I passed the SCJP exam yesterday and it sure feels great to be a Sun Certified Java Programmer. I did not know much about Java(other than it started with J) until I started studying about 3-4 weeks back. I went through RHE, JQPlus and DigitalThink.com towards the end. I also took the JavaRanch mock exam, Marcus Green's 3 mock exams and Pony's mocks. The mocks were much simpler than the actual exam, but were a good gauge to measure my Java knowledge.

Though "Declarations & Access Control" and "Language Fundamentals" were my strongest sections, I did better in several other sections. I got a 100% on java.util, java.lang and Garbage Collection. There were some tough questions on Threads(at least 7) and Inner Classes(which I had never liked). RHE was not enough for Threads, so I learned Threads from DigitalThink.com(though it is not free for everyone). I got 71% on Threads which I am happy with, considering the tough questions that I saw on this section.
There were some questions that seemed repetitive, like Strings have a default value of "null", and there were multiple questions that tested whether I knew this.
Good luck to all other Java aspiring programmers!

Jim,
Tough luck! The positive way to look at it is this: You wouldn't have felt great with just 61%, so put in your best for the next couple of weeks and aim for a perfect score.
I also started just 3 weeks back and gave it my best. Here are some resources that helped me:
Here are some resources that I found helpful:
1. http://www.geocities.com/SiliconValley/Orchard/9362/java/javacert/Desboro.htm
2. http://www.absolutejava.com/articles/java-tidbits.html
3. http://www.angelfire.com/or/abhilash/Main.html
(Get the answer explanations from the author.)
4. Maha's discussions on JavaRanch off http://www.javaranch.com/maha/Discussions/discussions.html
If you have time, go through Maha's discussions, as some concepts are very well explained. As you must have realized, the exam tests ones fundamentals. I got quite a few questions that looked similar to the Mock exams, but were actually tougher. I would strongly recommend that you try coding some programs. Finally, this cheat sheet REALLY helped me:
Two public classes in the same file.
Main method calling a non-static method.
Methods with the same name as the constructor(s).
Thread initiation with classes that dont have a run() method.
Local inner classes trying to access non-final vars.
Case statements with values out of permissible range.
Math class being an option for immutable classes !!
instanceOf is not same as instanceof
Private constructors
An assignment statement which looks like a comparison if ( a=true)...
System.exit() in try-catch-finally blocks.
Uninitialized variable references with no path of proper initialization.
Order of try-catch-finally blocks matters.
main() can be declared final.
-0.0 == 0.0 is true.
A class without abstract methods can still be declared abstract.
RandomAccessFile descends from Object and implements DataInput and DataOutput.
Map doesnot implement Collection.
Dictionary is a class, not an interface.
Collection is an Interface where as Collections is a helper class.
Class declarations can come in any order ( derived first, base next etc. ).
Forward references to variables gives compiler error.
Multi dimensional arrays can be sparce ie., if you imagine the array as a matrix, every row need not have the same number of columns.
Arrays, whether local or class-level, are always initialized,
Strings are initialized to null, not empty string.
An empty string is NOT the same as a null string.
A declaration cannot be labelled.
continue must be in a loop( for, do , while ). It cannot appear in case constructs.
Primitive array types can never be assigned to each other, eventhough the primitives themselves can be assigned. ie., ArrayofLongPrimitives = ArrayofIntegerPrimitives gives compiler error eventhough longvar = intvar is perfectly valid.
A constructor can throw any exception.
Initilializer blocks are executed in the order of declaration.
Instance initializer(s) gets executed ONLY IF the objects are constructed.
All comparisons involving NaN and a non-Nan would always result false.
Default type of a numeric literal with a decimal point is double.
integer (and long ) operations / and % can throw ArithmeticException while float / and % will never, even in case of division by zero.
== gives compiler error if the operands are cast-incompatible.
You can never cast objects of sibling classes( sharing the same parent ), even with an explicit cast.
.equals returns false if the object types are different. It does not raise a compiler error.
No inner class can have a static member.
File class has NO methods to deal with the contents of the file.
InputStream and OutputStream are abstract classes, while DataInput and DataOutput are interfaces.
All the best!
Dilshad
[This message has been edited by Dilshad Syed (edited March 21, 2001).]
23 years ago
Hello All,
I passed the SCJP exam 2 hours back and it sure feels great to be a Sun Certified Java Programmer. I did not know much about Java(other than it started with J) until I started studying about 3-4 weeks back. I went through RHE, JQPlus and DigitalThink.com towards the end. I also took the JavaRanch mock exam, Marcus Green's 3 mock exams and Pony's mocks. The mocks were much simpler than the actual exam, but were a good gauge to measure my Java knowledge.
Here are some resources that I found helpful:
1. http://www.geocities.com/SiliconValley/Orchard/9362/java/javacert/Desboro.htm
2. http://www.absolutejava.com/articles/java-tidbits.html
3. http://www.angelfire.com/or/abhilash/Main.html
(Get the answer explanations from the author.)
4. Maha's discussions on JavaRanch off http://www.javaranch.com/maha/Discussions/discussions.html
Though "Declarations & Access Control" and "Language Fundamentals" were my strongest sections, I did better in several other sections. I got a 100% on java.util, java.lang and Garbage Collection. There were some tough questions on Threads(at least 7) and Inner Classes(which I had never liked). RHE was not enough for Threads, so I learned Threads from DigitalThink.com(though it is not free for everyone). I got 71% on Threads which I am happy with, considering the tough questions that I saw on this section.
There were some questions that seemed repetitive, like Strings have a default value of "null", and there were multiple questions that tested whether I knew this.
Good luck to all other Java aspiring programmers!
23 years ago
Here is some code to prove the bartender's point:
<code>
public class Test{
public static void main(String args[]) {
System.out.println("The result of ((5/3)*3==5) is " + ((5/3)*3==5) ); //false
System.out.println("The result of ((5/3)*3==3) is " + ((5/3)*3==3) ); //true
}
}
</code>
Andy,
I disagree.
Firstly I don't think that one can make a stereotype about people who take MCSE. Secondly there are many people who take Microsoft as well as Sun certification exams, so what would you say about such people? Thirdly, I personally think that MSCE is tougher than Java. Have you looked at the course material for MCSE on W2K track? Not that I am an MCSE, but I would not underestimate the efforts put in by MSCE candidates.
By the way, just Java OR just MSCE is not enough for a professional these days.
I would also like to mention that Sun prohibits candidates to share questions from the exam. Moreover it is unethical as a lot of candidates put in several months towards the certification and someone who has access to such a question bank, can pass with minimal efforts. However, it would be interesting to indirectly discuss difficult scenarios that one comes across.
Dilshad
First there's Declaration, then Allocation and finally Initialization. Once you allocate the memory for the array, it is automatically initialized. But if you only declare it and try to access the array, you will get an error.
Here is the question:
Write a line of code that declares a variable named 'layout' of subclass of class LayoutManager and initializes it with a new object, which when used with a container can lay out components in a rectangular grid having exactly 1 column and any number of rows.
When 2 components are added to BorderLayout at the same location, the first one is removed from the container. In this case, there will only be one button left(Button3) which will be visible.
[This message has been edited by Dilshad Syed (edited March 11, 2001).]
We still don't seem to have a definite answer, can someone shed some light on this one?
Someone mentioned that this question was asked on an exam which didn't give the answers at the end.
Thanks!
To a frame, you want to add the following:
1. TextArea
2. Label
3. Button
Which layout manager will you use so that the TextArea occupies all the vertical space when the frame is resized?
What does the following code print out?
byte b1 = -5;
int i = 0xff;
byte b2 = (byte)(b1 ^ i);
System.out.println(b2);
Can someone explain why it is 4? Thanks!