Basic concept about member class methods and variables.

 

This example was created with "TextPad" trial version.

import java.util.*;
import java.io.*;
//javac test_final_2.java
public class test_final_2
{
private int player_no = 12;
public test_final_2()
{ System.out.println("This is a constructor with no param");
}
public static void main(String[] args) throws IOException
{
BufferedReader br = new BufferedReader
(new InputStreamReader(System.in));
System.out.print("Type something : ");
String str = "";
str = br.readLine();
test_final_2 t = new test_final_2();
t.method_2();
t.get_no(str);
//calling method_2() again
t.method_2();
}
public void get_no(String str)
{
final int player_no = 24;
this.player_no = player_no;
System.out.println(str + " Your Unform No now : " + player_no);
}
public void method_2()
{
String str = "public player_no was : " ;
System.out.println(str + player_no);
}
}