• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need a password validation java program using JDK 1.3  RSS feed

 
S. Sule
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

need a password validation java program using JDK 1.3, specially to validate special character like &,*,$ etc

Code given below,

Thanks
Saurabh


 
Tim Cooke
Marshal
Posts: 4051
239
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java 1.3? Really? That release is 15 years old! Time to move to a newer version, the latest is Java 8.

But back to your program. What exactly is wrong with it that you are seeking assistance with?
 
S. Sule
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi mate

Actually one of our application is running on jdk 1.3, so need to code according to that.

In my code contains keyword is not working,
my basically concern is how to validate mentioned special characters in jdk 1.3
 
Tim Cooke
Marshal
Posts: 4051
239
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not working how? Please be specific. What's the expected behaviour? What's the actual behaviour?
 
S. Sule
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Contains keyword is not supported in jdk 1.3, can you suggest me how i can validate special characters in password string using jdk 1.3
 
Paweł Baczyński
Bartender
Posts: 2087
44
Firefox Browser IntelliJ IDE Java Linux Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all, contains is not a keyword in Java. It is a name of a method added to String class in 1.5 version.

In 1.3 I would use indexOf method. You already use it in your code.

But 1.3... Really?
 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
S. Sule wrote:Contains keyword is not supported in jdk 1.3, can you suggest me how i can validate special characters in password string using jdk 1.3


step 0) SERIOUSLY consider upgrading to a modern version of java. There is almost no valid reason to continue developing on a platform that is 15 years old.

then...

step 1) read what the contains method does (note: it is a method, not a keyword)
step 2) look at what methods are available in java 1.3 (uggghhh)
step 3) write code that does the same thing.

Which part do you need help with?
 
S. Sule
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok..my scenerio is

say example

string password="mydata@12me

string splcharacters= new String[10];

splcharacters[0] = "&";
splcharacters[1] = "*";
splcharacters[2] = "$";

now i need to find whether my password contains above splcharaters

using JDK 1.3 only
 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
S. Sule wrote:ok..my scenerio is

say example

string password="mydata@12me

string splcharacters= new String[10];

splcharacters[0] = "&";
splcharacters[1] = "*";
splcharacters[2] = "$";

now i need to find whether my password contains above splcharaters

using JDK 1.3 only

FORGET all about java. Tell us in English how YOU would look for these special characters if all you had were pencils and paper and erasers.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!