alzamabar

Ranch Hand
+ Follow
since Jul 24, 2002
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 alzamabar

Hi, I just wrote an Open Source, lightweight, standalone, easy to use Spring-based container.

Documentation and code can be found here:

http://www.jemos.co.uk/projects/jeco/docs/index.html

Enjoy!!
Hi, I thought I would make available an help guide for the SCJP 5. You can find the document

here

The document contains sample code and tricky questions which usually make the life of who's approaching the exam difficult. It is not supposed to be a full coverage of the language and/or of the exam, but some of the points in the document may help you in getting another answer right
Hi, ensure that you have setup the following property in the Properties object that you pass into the constructor of the Session object:

prop.put("mail.smtp.auth", "true");

Marco
14 years ago
Hi, I found this book around (not yet available according to Amazon uk):

Sun Certified Developer for Java Web Services Study Guide (Exam 310-220)

Is this the first book about the Web Services exam? What about HF series? I'd happily buy a HF about the Web Services certification. Think about it
14 years ago

Originally posted by Srinivasa Raghavan:
Yep i agree this

If either operand is of type double, the other is converted to double.

But it should be negative right or am i going wrong any where ?
I mean -2.0 == -2

[ May 10, 2005: Message edited by: Srinivasa Raghavan ]



Yes it should be negative. Sorry for the typo
It typically refers to the oo paradigm. Typically, a subclass (or an implementing one in case of the overridden method defined in an interface) declares a set of exceptions, that is it defines a 'contract' (i.e. the method signature). When overriding a method, it means that an application wants to define a 'specialized' version of that method. The general contract for overriding is that a child class can do whatever the superclass does, but nothing outside of it. A superclass method must be as more generic as possible (therefore declaring broad exceptions), but a specialized class may not throw ALL the exceptions declared by the superclass, therefore in its signature the subclass is not required to declare all the superclass's methods.

Let's consider the following:


Considering that BroadChildException is a subclass of BroadException, this is valid code, i.e. the subclass can declare an exception which is a subclass of the exception declared in the superclass. The child class can also declare no exception, that is to say: 'I don't care about BroadExceptions at all, because I don't throw it'.

But...

The child class cannot be something like this:



because it declares an exception that its parent doesn't. Now, when programming with OO, you need to understand that super and sub classes are seen as one and a scenario as the above would cause a disalignment between super and subclass.

As a general rule: When defining types and exceptions the child bust be under the parent 'supervision' like in a sandbox.

Originally posted by Srinivasa Raghavan:

It should be -2.0 == -2.0



No, it should be -2.0 == 2

From Java Language Specification (chapter 5.6.2):


If either operand is of type double, the other is converted to double.



Therefore 2 is promoted to be 2.0 and the two results are equal.

You can run the following code for testing:

Originally posted by amit taneja:
hi in chapter 6...

in one question...


Given the following,
1. public class Example {
2. public static void main(String [] args) {
3. double values[] = {-2.3, -1.0, 0.25, 4};
4. int cnt = 0;
5. for (int x=0; x < values.length; x++) {
6. if (Math.round(values[x] + .5) == Math.ceil(values[x])) {
7. ++cnt;
8. }
9. }
10. System.out.println("same results " + cnt + " time(s)");
11. }
12. }
what is the result?
A. same results 0 time(s)
B. same results 2 time(s)
C. same results 4 time(s)
D. Compilation fails.
E. An exception is thrown at runtime.


its anser is "B"

but don't understand why... i am not able to understand its explaination...
kindly clear the doubt...

thanx



The logic is as follows:

-2.3 and 0.25 are the correct answers.

For -2.3:

(-2.3 + .5) == -1.7
-1.7 Rounded == -2.0

-2.3 Ceiled == -2

Therefore -2.0 == 2


For 0.25:

(0.25 + .5) == 0.75
0.75 Rounded == 1.0

0.25 Ceiled == 1

Therefore 1.0 == 1


-1.0 is not correct because:

(-1.0 + .5) == -.5
-.5 Rounded == 0

-1.0 Ceiled == -1.0

Therefore 0 != -1.0


4 Is incorrect because:

(4 + .5) == 4.5
4.5 Rounded == 5

4 Ceiled == 4

Therefore 4 != 5
Hi, I'm studying that connections should be performed through a separate thread. My question is: is it possible to create a separate Thread which is NOT a MIDlet to perform, let's say, an http connection and then invoke this Thread from a MIDlet?

I tried, maybe I am doing something wrong, but the separate thread solution doesn't work. In few words, the emulator doesn't ask me for permissions to go online and nothing else happens. On the other hand, if I create my MIDlet to be also the thread which runs the connection, everything works fine.

Any idea?

Thank you.
Hi guys, as I've done with SCBCD and SCWCD, I'm writing a document which could be of help while preparing for the SCMAD. I started studying 'seriously' today, therefore the document is far from complete. Nevertheless is another voice in the chorum in the hope that it will help whoever, like me, is going for this cert.

You can find it at the following address:

Jemos home page

and then following the link for SCMAD.

I'll keep the document updated as long as my studies progress.

All the best guys and good luck with your exam.

Originally posted by Billy Tsai:
I suppose there just aren't enough J2ME jobs like J2EE has

[ March 23, 2005: Message edited by: Billy Tsai ]



Surprisingly enough, it seems the opposite, at least here in the UK. There are more job requirements for J2ME developers than actuallyl people available.
a) HF EJB,
b) HF Servlet/JSP
c) How Tomcat Works, edited by BrainySoftware, written by Budi Kurniawan and Paul Deck
d) Wireless Java, Developing with J2ME, edited by Apress, written by Jonathan Knudsen
15 years ago
Hi guys, I realize there aren't many people going for the SCMAD; maybe with a HF Midlets/CLDC the number would increase?

I'm studying on my own, due to business requirements; if you need help in writing the book, I'm happy to help.

Regards,
15 years ago
Hi guys, I'm beginning the preparation for the SCMAD. At the moment, I'm studying:

'Wireless Java: Developing with J2ME'
Second edition, edited by Apress, written by Jonathan Knudsen.

From the posts I've read here, there are a lot of specs to read for the exam.

Anyone can tell me how good is the Whizlab exam?