C# : What is the correct way to initiate a class in a class?
===

What is the correct way to initiate a class in a class? should I put StreamWriter in a method? or this is fine?
`class Class1
{ public string config = "file.config";StreamWriter writer = new StreamWriter(config); public void print (string log) {writer.WriteLine(log);} public void log_close() {writer.Close();}`