fork download
/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		String s = "task_123";
		String[] paths = s.split("_");
		int type = 1;
		int i = Integer.getInteger(Integer.toString(type) + paths[1], 0);
		int j = Integer.getInteger(type + paths[1], 0);
		System.out.println(i);
		System.out.println(j);
	}
}
Success #stdin #stdout 0.06s 380224KB
stdin
Standard input is empty
stdout
0
0