Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link

sushil bhogale

+ Follow
since Mar 13, 2007
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sushil bhogale

byte = -42; It gets represented in bits as 1010 1010. How it gets represented as int i.e. in 32 bits ?
Sorry... it should be

char c = 3;
int i = 3; ==> this should be final int i = 3
c = 1;

2. In response, I have wrongly written Antonio's name from other thread...
char c = 3;
int i = 3;
c = 1;
These both cases are of "Implicit narrowing primitive conversion on assignments" and hence it worked. it to work rules are -
1. The source should be a constant expression either of byte, short, char or int.
2. Also the destination should either be byte, short, char or int.
3. Most important the value should be in range.

To make it work...
final int i = 2; // final mentions here that its a constant source...
c = i;

On the other hand follwing would not work
int i1 = 10;
final int i2 = i1;
char c = i2;
becase, at compile time i2 does not have any value.

Hope it works.

First place, whether these programs would get compile ? Put some light on it.
Abstract classes are used when you want to share a common implemnetaion acorss the sub class but still sub class can have few differences.
| |
Automatica Manual

Now, Car has implementation of runs() method as both types would use the same style to run. But the way it starts i.e. gear() is abstract and is very specific to the type of Car.
There are different states for thread
1. New
2. Runnable
3. Running
4. Dead
5. Blocked / Waiting.

A thread is in New state, when it is just instantiated. to put into Runnable state, start() method should be invoked. Now thread goes into its Running mode, when JVM decides it to run (again JVM specific). Now such a runnign thread can be moved from Running to the Runnable state by following ways -
1. Sleep - for specific time
2. Wait - on the mercy of other threads to notify
3. Blcoked for any I/O Expception

Once the run() method gets over, a thread can not be made Live again. It would throw an exception.
The Garbage control is under the conrol of JVM. The JVM decided when to run GC. So, though have made references NULL, its not necessarily that GC has been performed on them. Experinece suggest that it runs only when JVM senses that memory is running low.

Also, if you are writing one stand-alone code and running from the command prompt, do not expect to get the output as GC runs in other JVM than your program.


Among plenty of the garbase collector's algorithm, following are the two important once -
1. mark and sweep &
2. reference counting.
But Java specification does not gurantee any particular implementation. Its important to understand that any object becomes eligible for garbage collection when NO LIVE thread can access it. Object can be accessed by any thread only if object is reachable i.e. it should have some reachable reference.

Please write a finalize() method and invole GC.
Initial version to use Java Web Service is JAX-RPC 1.0. But during next version 2.0, the folks realized that the industry was not merely doing RPC Web services, but they were also doing message-oriented Web services. So "RPC" was removed from the name and replaced with "WS" (which stands for Web Services, of course). Thus the successor to JAX-RPC 1.1 is JAX-WS 2.0 - the Java API for XML-based Web services.

In order to understand and learn web services -
1. Download TomCat 5.0 [as 6.0 has version mis-match issue with Axis 1.4]
2. AXIS 1.4 [ java2wsdl command - to create WSDL file]
3. Learn WSDL format - basically the different tags
15 years ago