• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java Password Generator with Abstract classes

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator











Need help...I've done all this, and now i'm stuck with the question of how to instantiate something. I've done all this and now i'm just completely stuck and have been trying to get this done, but overall this has kept me stuck. The next steps are Uses the password to instantiate a new Password reference, which points to a EncryptedPassword object.......Calls the getPassword, getEncryptionMethod, and toString methods of the newly instantiated object, and prints the information to the screen..........Prompt the user to re-enter the password and tell them whether or not they entered it correctly..... Those 3 steps have gotten me stuck. The code might not be exactly right, but i think its good all the way through. I was hoping i could get some help, or maybe some tips to even get passed the first step on my driver program. If anyone could help it would mean alot. Thank you..
 
Sheriff
Posts: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can't instantiate an object from an abstract class, and all you've show us here are abstract classes. You're going to have to make a concrete (i.e., non-abstract) class extending one of these and implement that decrypt() method before you can instantiate anything.
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Nolan,

Firstly, - do as Greg has mentioned.

Then you need to figure out if the username and password is correct or not. For this you will need to access your Database, and query for the user entered username and password. I cannot give you any more detail here before you mention what technology you will be using for DB access.

Another thing is you mention calling getPassword and printing on the screen. This is not a done thing in any app - ever!

for the final step you have mentioned you just need a loop that would return when login is successful. Something like this (note I have not used your KeyboardReader class as that must be a proprietary thing you are using)


 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic