0

Can anyone point the difference between the List and List<Object> in Java.

Also how does java differentiate the old collections and new Generic supported classes ?

How does it make it backward compatible?


package com.example.rohitsapp;

import android.os.Bundle;
import android.app.Activity;       
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity extends Activity {

 @Override
 protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    final EditText editText1 = (EditText) findViewById(R.id.editText1);
    final EditText editText2 = (EditText) findViewById(R.id.editText2);

    Button b= (Button) findViewById(R.id.button1);

    b.setOnClickListener(new OnClickListener() {

        public void onClick(View arg0) {
            String data = editText1.getText().toString();

            editText2.setText(data);
        }

    });

    }

 @Override
 public boolean onCreateOptionsMenu(Menu menu) {

     getMenuInflater().inflate(R.menu.main, menu);
     return true;
 }

}

4

0 回答 0