Object[] a = new Object[10];
a[0] = 10;
a[0] = new Integer(10); //тоже самое
public final void setText(int resid) {
setText(getContext().getResources().getText(resid));
}
textview2.setText(String.valueOf(str));
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView textView = (TextView) findViewById(R.id.textView);
File sdCard = Environment.getExternalStorageDirectory();
File[] list = sdCard.listFiles();
for (File f : list) {
String fileAbsPath = f.getAbsolutePath().toString();
fileAbsPath = fileAbsPath.replaceAll("[^\\x20-\\x7e]", "");
textView.append(fileAbsPath);
textView.append("\n");
}
textView.append("\n");
for (File f : list) {
String fileAbsPath = f.getAbsolutePath().toString();
textView.append(fileAbsPath);
textView.append("\n");
}
}
import gnu.jel.CompilationException;
import gnu.jel.CompiledExpression;
import gnu.jel.Evaluator;
import gnu.jel.Library;
public class Main {
private static final String EVAL_VALUE = "3243-854+6-100";
public static void main(String[] args){
JELSample();
}
private static void JELSample(){
try {
Class[] staticLib = new Class[1];
staticLib[0] = Class.forName("java.lang.Math");
Library lib = new Library(staticLib, null, null, null, null);
CompiledExpression compiledExpression = Evaluator.compile(EVAL_VALUE, lib);
Object result = compiledExpression.evaluate(null);
System.out.println("JEL: " + result);
} catch (CompilationException e) {
e.printStackTrace();
} catch (Throwable throwable) {
throwable.printStackTrace();
}
}
}