假设我有一个source.java
与下面相同的 java 源文件 ( )。
1 package demo;
2
3 public class Source {
4
5 public static void main(String[] args) {
6
7 String sample = "foo bar";
8
9 System.out.println(sample.length());
10
11 }
12 }
Run Code Online (Sandbox Code Playgroud)
现在我想编写一个java代码,逐行读取这个源文件,当它遇到第9行中的变量时,它会告诉我样本变量属于sample
哪个类(即)。java.lang.String
我怎样才能做到这一点?我已经看到下面的链接,它对我不起作用,因为它在同一源文件中打印类型名称。
我有这个问题:
\n\nBuilder\n(android.content.Context)\nin Builder\xc2\xa0cannot be applied\nto\n(anonymous android.content.DialogInterface.OnClickListener)\n
Run Code Online (Sandbox Code Playgroud)\n\n在此代码上:
\n\nAlertDialog ventana;\n ventana=new AlertDialog.Builder(this).create();\n ventana.setTitle("COBARDE");\n ventana.setMessage("Rendidse es de debiles,a seguir jugando");\n ventana.show();\n ventana.setButton(8,"Confirmar", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialogo1, int id) {\n aceptar();\n }\n public void aceptar(){\n AlertDialog ventana2;\n ventana2=new AlertDialog.Builder(this).create();\n ventana2.setTitle("puto");\n ventana2.setMessage("Rendidse es de debiles,a seguir jugando");\n ventana2.show();\n }\n\n });\n
Run Code Online (Sandbox Code Playgroud)\n\n有人可以解决这个问题吗?我正在尝试将一个警报对话框放入另一个警报对话框中
\n