加密客户端用户输入的密码和Java应用程序中服务器解密的最佳方法是什么?
基本上我想确保客户输入的所有数据都是安全的.
关心Tarun Sapra
如果java总是通过引用传递变量,为什么eclipse会在没有任何考虑的情况下生成bean.
代替:
return myStr;
需要是
return new String(myStr);
没有?
编辑
确定,我的例子很糟糕.
让我们离开eclipse,当我想要返回一个Custom对象时.我是否需要创建一个"复制构造函数"并将其返回,如下所示:
return new MyCustomObject(myCustomObject);
class MyCustomObject{
private String str;
public MyCustomObject(String str){
this.str = str;
}
public MyCustomObject(MyCustomObject obj){
this.str = obj.str;
}
}
Run Code Online (Sandbox Code Playgroud)
我必须写那个吗?
我正在尝试编写一个看起来像这样的界面
public interface IPropertyGroupCollection
{
IEnumerable<IPropertyGroup> _Propertygroups { get;}
}
public interface IPropertyGroup
{
IEnumerable<IProperty<T, U, V>> _conditions { get; }
}
public interface IProperty<T, U, V>
{
T _p1 { get; }
U _p2 { get; }
V _p3 { get; }
}
public class Property<T, U, V> : IProperty<T, U, V>
{
//Some Implementation
}
Run Code Online (Sandbox Code Playgroud)
我继续为_Conditions的可枚举定义获取编译错误.
我究竟做错了什么?Idea是实现类将提供通用属性包集合
我有以下字符串:
Arsenal (0) - Swansea City (3)
Run Code Online (Sandbox Code Playgroud)
第一步我想得到数字(在这种情况下为0和3)第二步从字符串中删除(数字).