TextView textView = findViewById(R.id.textView); textView.setText("Hello, World!");
TextView textView = new TextView(context); textView.setText("Hello, World!");In this example, we are creating a new instance of TextView and setting its text to "Hello, World!". This can be useful when dynamically creating views at runtime. The android.widget.TextView class is part of the Android SDK and does not require any external library packages.