我想说我正在用简单的编码学习语言.
如果我创建一个对象ResourceTemplate作为
public class ResourceTemplate
{
public string Name;
public int Value;
}
Run Code Online (Sandbox Code Playgroud)
然后做了
List<ResourceTemplate> resource = new List<ResourceTemplate>();
Run Code Online (Sandbox Code Playgroud)
该资源将是一个具有结构的列表ResourceTemplate.如果是这样,为什么我不能使用 resource.Add("product", 500);?
编译器说它不能对ResourceTemplate函数进行重载.
介绍
我正在尝试从两个纪元中获得几秒钟的差异
即
2019-05-22 18:28:56-> 1558542536秒
2019-07-22 19:00:00-> 1563814800秒
差异将是:5,272,264?秒
此日期格式来自二进制文件,作为字符串
我的密码
public static void main(String[] args) throws ParseException
{
String regEpoch = "";
long result = 0;
//System.out.println((fecha = dateFormat.format(date)));
try(RandomAccessFile raf = new RandomAccessFile("binario2.txt", "rw")){
//user inputs a code (for now, doesn't matter if exists or not)
System.out.print("Input a code to look for: ");
String code = scan.next();
while(!code.matches("\\d+"))
{
System.out.println("[ERROR] Only digits accepted");
System.out.print("Input a code to look for: ");
code = scan.next();
}
//Gets the …Run Code Online (Sandbox Code Playgroud)