[JAVA] [Note] Self-made code trace history method

Generics <>

For example, private ArrayList list = new Arraylist <> (); When there is, a function to limit the type that only string type can be put in list There may be other functions, but I will omit them here.


constructor

The one written as class name () is called a constructor, and member variables can be set. If it is a class name (String name, int age) If the name is a String type age, an int type object can be set.


@Override

I'm overriding it. What is an override? Redefine the method defined in the parent class in the child class.


protected

The protected defined in the subclass has the meaning that you can access the superclass. Example) protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);

    	initView();
	}

In the above example, "super." Is used in the method. This is used when you want to access onCreate used in the superclass (parent class).


onCreate

Write the one in which the activity was created for the first time. The initial state is like this onCreate.


onResume

Write the one when Activity is displayed. In my code, describe the display when the view is redisplayed.


onPause

Activity pause. For example, the process of displaying the clock in the view is not necessary if the app is not running. So, write a process to pause in onPause.


Recommended Posts

[Note] Self-made code trace history method
[Note] Self-made code trace history class-method
[Note] Self-made code trace history class-method
Note the StringUtils # containsAny method
Code entry method in Qiita
Java test code method collection