Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class foo
- {
- public int value;
- }
- class bar
- {
- bar()
- {
- m_foo = new foo();
- m_foo.value = 42;
- }
- private m_foo;
- foo getFoo(){return m_foo;}
- }
- class main
- {
- int main()
- {
- bar b = new bar();
- b.getFoo().value = 37;
- }
- }
- using System;
- namespace ConsoleApplication1
- {
- public class foo
- {
- public int value;
- };
- public class bar
- {
- public bar()
- {
- m_foo = new foo();
- m_foo.value = 42;
- }
- private foo m_foo;
- public foo getFoo() { return m_foo; }
- };
- public class Program
- {
- public static int Main()
- {
- bar b = new bar();
- b.getFoo().value = 37;
- return 0;
- }
- };
- }
- class bar
- {
- private m_foo;
- bar()
- {
- m_foo = new foo();
- m_foo.value = 42;
- }
- foo Foo
- {
- get { return m_foo;}
- }
- }
Add Comment
Please, Sign In to add comment