title: I am getting a compile time error in android studio when i build the project - error: incompatible types: int cannot be converted to String
body: <p>I don't have any syntax error. but when i build the program, it shows compilation error as follows :</p>
  
  <pre><code>error: incompatible types: int cannot be converted to String
  Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
  
  Error:Execution failed for task ':app:compileDebugJavaWithJavac'.               
  &gt; Compilation failed; see the compiler error output for details.
  </code></pre>
  
  <p>This is my json array:</p>
  
  <pre><code> {"students":[
               {"id":"1","firstname":"JOHN","lastname":"MATHEW","age":"25"},
               {"id":"2","firstname":"SANDY","lastname":"SINGH","age":"23"},
               {"id":"3","firstname":"MAYA","lastname":"TOMMY","age":"20"},
               {"id":"4","firstname":"AMBI","lastname":"SHIZ","age":"25"}
             ]
   }
  </code></pre>
  
  <p>Here is the code. I am using Android Studio and Volley library in it. </p>
  
  <p>MainActivity.java</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      EditText firstname, lastname, age;
      Button insert, show;
      TextView result;
      RequestQueue requestQueue;
      String insertUrl = "http://localhost/android_volleytest/insertStudent.php";
      String showUrl = "http://localhost/android_volleytest/connection.php";
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          firstname = (EditText) findViewById(R.id.fname);
          lastname = (EditText) findViewById(R.id.lname);
          age = (EditText) findViewById(R.id.age);
          insert = (Button) findViewById(R.id.insert_btn);
          show = (Button) findViewById(R.id.show_btn);
          result = (TextView) findViewById(R.id.txtView);
  
          requestQueue = Volley.newRequestQueue(getApplicationContext());
  
          show.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.POST,
                          showUrl, new Response.Listener&lt;JSONObject&gt;() {
                      @Override
                      public void onResponse(JSONObject response) {
                          try {
                              JSONArray students = response.getJSONArray("students");
                              for (int i = 0; i &lt; students.length(); i++) {
                                  JSONObject student = students.getJSONObject(i);
  
                                  String firstname = student.getString("firstname");
                                  String lastname = student.getString("lastname");
                                  String age = student.getString("age");
  
                                  result.append(firstname + " " + lastname + " " + age + "\n");
                              }
                              result.append("======\n");
                          } catch (JSONException e) {
                              e.printStackTrace();
                          }
  
                      }
                  }, new Response.ErrorListener() {
                      @Override
                      public void onErrorResponse(VolleyError error) {
  
                      }
                  });
                  requestQueue.add(jsonObjectRequest);
              }
          });
  
          insert.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  StringRequest request = new StringRequest(Request.Method.POST, insertUrl,
                          new Response.Listener&lt;String&gt;() {
                              @Override
                              public void onResponse(String response) {
  
                              }
                          }, new Response.ErrorListener() {
                      @Override
                      public void onErrorResponse(VolleyError error) {
  
                      }
                  }) {
                      @Override
                      protected Map&lt;String, String&gt; getParams() throws AuthFailureError {
                          Map&lt;String, String&gt; parameters = new Hashtable&lt;String, String&gt;();
                          parameters.put("firstname", firstname.getText().toString());
                          parameters.put("lastname", lastname.getText().toString());
                          parameters.put("age", age.getText().toString());
                          return parameters;
                      }
                  };
                  requestQueue.add(request);
              }
          });
      }
  }
  </code></pre>
  
  <p>activity_main.xml</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"
  tools:context=".MainActivity"
  android:weightSum="1"&gt;
  
  &lt;EditText
      android:id="@+id/fname"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:gravity="center_horizontal"
      android:hint="@string/edit_fname" /&gt;
  
  &lt;EditText
      android:id="@+id/lname"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:gravity="center_horizontal"
      android:hint="@string/edit_lname" /&gt;
  
  &lt;EditText
      android:id="@+id/age"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:gravity="center_horizontal"
      android:hint="@string/edit_age" /&gt;
  
  &lt;Button
      android:id="@+id/insert_btn"
      android:text="@string/btn_insert"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:gravity="center_horizontal"
      android:textSize="25sp"
      android:onClick="startRequest"
      /&gt;
  &lt;TextView
      android:id="@+id/txtView"
      android:background="#99EB99"
      android:layout_width="match_parent"
      android:layout_height="285dp"
      android:textSize="15sp" /&gt;
  
  
  &lt;Button
      android:id="@+id/show_btn"
      android:text="@string/btn_show"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:gravity="center_horizontal"
      android:textSize="25sp"
      android:onClick="startRequest"
      /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>gradle console</p>
  
  <pre><code>Executing tasks: [clean, :app:compileDebugSources, :app:compileDebugAndroidTestSources]
  
  Configuration on demand is an incubating feature.
  :app:clean
  :app:preBuild UP-TO-DATE
  :app:preDebugBuild UP-TO-DATE
  :app:checkDebugManifest
  :app:preReleaseBuild UP-TO-DATE
  :app:prepareComAndroidSupportAppcompatV72300Library
  :app:prepareComAndroidSupportSupportV42300Library
  :app:prepareDebugDependencies
  :app:compileDebugAidl
  :app:compileDebugRenderscript
  :app:generateDebugBuildConfig
  :app:generateDebugAssets UP-TO-DATE
  :app:mergeDebugAssets
  :app:generateDebugResValues UP-TO-DATE
  :app:generateDebugResources
  :app:mergeDebugResources
  :app:processDebugManifest
  :app:processDebugResources
  :app:generateDebugSources
  :app:processDebugJavaRes UP-TO-DATE
  :app:compileDebugJavaWithJavac
  C:\Users\shabeer\AndroidStudioProjects\MyApplication\app\src\main\java\com\example\shabeer\myapplication\MainActivity.java:52: error: incompatible types: int cannot be converted to String
                  JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.POST,
                                                                                            ^
  Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
  1 error
  
   FAILED
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':app:compileDebugJavaWithJavac'.
  &gt; Compilation failed; see the compiler error output for details.
  
  * Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
  
  BUILD FAILED
  
  Total time: 5.072 secs
  </code></pre>