Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f38035f

Browse files
author
C5141506
committed
Codility codebase
1 parent 961bc4e commit f38035f

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package java_problem.company_test
2+
/*
3+
* Here first constructor initialize then
4+
* init will execute then constructor statements will execute.
5+
* */
6+
class Example(private var s: String) {
7+
constructor(a: String, c: String) : this(a) {
8+
this.s += c
9+
println(this.s)
10+
}
11+
12+
init {
13+
s += "B"
14+
println(s)
15+
16+
}
17+
}
18+
19+
fun main() {
20+
Example("A", "C")
21+
}
22+
23+
/*
24+
*
25+
* output
26+
* AB
27+
* ABC
28+
*
29+
* */

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /