repo.or.cz
/
mono-project.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
[LoongArch64] Part-5:add loongarch support in some files for LoongArch64. (#21769)
[mono-project.git]
/
mcs
/
tests
/
gtest-initialize-01.cs
blob
a203d528306db77fa627b69a66bca736bd768c7c
1
2
// Tests object initialization
3
using
System
;
4
using
System
.
Collections
;
5
6
public class
MyClass
7
{
8
public string
Foo
=
"Bar"
;
9
private int
answer
;
10
public int
Answer
{
11
get
{ return answer; }
12
set
{ answer = value; }
13
}
14
}
15
16
public class
Test
17
{
18
public static int
Main
()
19
{
20
MyClass mc
=
new
MyClass
()
{ Foo = "Baz", Answer = 42 }
;
21
if
(
mc
.
Foo
!=
"Baz"
)
22
return
1
;
23
if
(
mc
.
Answer
!=
42
)
24
return
2
;
25
26
return
0
;
27
}
28
}