使用完整单词作为登录系统的变量 [英] Using full words as variables for login system

查看:94
本文介绍了使用完整单词作为登录系统的变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个登录系统,当前使用硬编码整数表示用户ID,密码和学号,这意味着它们都是数字。我可以用什么来制作整数(用户ID和密码)字而不是数字?这是它目前的样子;

I'm creating a login system that currently uses hard coded integers for a UserID, password and Student number which means they are all numbers. What would I use to be able to make the integers (the UserID and password) words instead of numbers? This is how it currently looks;

public static void main(String[] args) {

    final int UserID = 5555; 
    final int Password = 1234;
    final int StudentNumber = 22334455;


推荐答案

    final int UserID = 5555; 
    final int Password = 1234;
    final int StudentNumber = 22334455;
String UserID_str = String.valueOf(UserID);
String Password_str = String.valueOf(Password);
String StudentNumber_str = String.valueOf(StudentNumber);

这篇关于使用完整单词作为登录系统的变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆