File tree Expand file tree Collapse file tree
src/ru/javawebinar/basejava Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package ru .javawebinar .basejava ;
2+
3+ import ru .javawebinar .basejava .model .SectionType ;
4+
5+ public class TestSingleton {
6+ private static TestSingleton instance ;
7+
8+ public static TestSingleton getInstance () {
9+ if (instance == null ) {
10+ instance = new TestSingleton ();
11+ }
12+ return instance ;
13+ }
14+
15+ private TestSingleton () {
16+ }
17+
18+ public static void main (String [] args ) {
19+ TestSingleton .getInstance ().toString ();
20+ Singleton instance = Singleton .valueOf ("INSTANCE" );
21+ System .out .println (instance .ordinal ());
22+
23+ for (SectionType type : SectionType .values ()) {
24+ System .out .println (type .getTitle ());
25+ }
26+ }
27+
28+ public enum Singleton {
29+ INSTANCE
30+ }
31+ }
Original file line number Diff line number Diff line change 1+ package ru .javawebinar .basejava .model ;
2+
3+ public enum SectionType {
4+ PERSONAL ("Личные качества" ),
5+ OBJECTIVE ("Позиция" ),
6+ ACHIEVEMENT ("Достижения" ),
7+ QUALIFICATIONS ("Квалификация" ),
8+ EXPERIENCE ("Опыт работы" ),
9+ EDUCATION ("Образование" );
10+
11+ private String title ;
12+
13+ SectionType (String title ) {
14+ this .title = title ;
15+ }
16+
17+ public String getTitle () {
18+ return title ;
19+ }
20+ }
21+
You can’t perform that action at this time.
0 commit comments