Results 1 to 2 of 2
Thread: How to compare Built_versions???
- 09-22-2008, 08:06 PM #1
Member
- Join Date
- Sep 2008
- Posts
- 2
- Rep Power
- 0
How to compare Built_versions???
A client application needs to determine if the server to which it is connecting is compatible.
The server will inform the client which versions it supports, for instance responding with a min_version="5.0.1_1" and a max_version="5.0.10_1".
The client application needs to compare these versions with its own build version, for instance build_version="5.2.6_5" would be compatible.
Please produce client code using Java that will indicate to the user whether the client is:
a) compatible with the server
b) older than the minimum supported version
c) newer than the maximum supported version
How can we compare the build_version, which is a string???
How can we separate the numbers and compare the versions???
- 09-23-2008, 04:06 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
In such a case what I have done is the client version records in a config file. Actually in each client should have a configuration file. Because we have to make certain changes time to time.
Then if you want to test those versions on server and client, simply get them as strings and compare. You can use equals() for that.
Similar Threads
-
How to Compare two Dates
By Java Tip in forum java.utilReplies: 1Last Post: 06-24-2008, 07:05 AM -
Compare 5 numbers
By Snowboardmylife in forum New To JavaReplies: 5Last Post: 04-15-2008, 07:04 PM -
Compare lists
By JavaNoob in forum New To JavaReplies: 2Last Post: 08-08-2007, 03:11 PM -
Compare 2 XML
By Peter in forum XMLReplies: 1Last Post: 07-05-2007, 02:58 AM -
compare speed
By bbq in forum JDBCReplies: 1Last Post: 06-28-2007, 05:34 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks