It seems i was not clear in putting my question :
This is what i want to do
Firstly, the string i have is not a static string.
I need to write data to a buffer. The data can be
anything. I have a class which returns me two vectors
say V1 and V2.
V1 = ".Int" // just for this example
V2 = "index" // index is the name of that int
variable.
Now i construct this string in my program.
String str = "buffer.write" + V1 + "(" + V2 +");"
and now i want to execute this statement , which i
have in the form String str.Here buffer is an
instance of ByteBuffer.