我有一些课程说我有20个课程有不同的目标.现在我想做的是我想制作一个包含所有这些文件的jar文件.我想这样做是因为我想在其他项目中将这些类用作单个Jar.我怎样才能做到这一点?
有什么方法可以让下面的表达式作为常量表达式进行计算?如果有帮助的话,我正在使用 Java 11。
String.format("hello %1$s","world");
Run Code Online (Sandbox Code Playgroud) I'm trying to convert an array of chars to an array of doubles with each one between 0-1, so that a would be 0 and z would be 1. Currently, I've thought of this method,
public static double[] charToDouble(char[] chars){
double[] doubles=new double[chars.length];
double one=1;
double twentySix=26;
double eachChar=one/twentySix;
for(int i=0; i<chars.length; i++){
int charNum=((int)input)-96;
doubles[i]=eachChar*charNum;
}
return doubles;
}
Run Code Online (Sandbox Code Playgroud)
but a would be converted to 1/26 instead of 0.