'WEB-INF'에 해당되는 글 916건

[Java] Static

Back-End/Java_1 2016. 5. 11. 15:16
donaricano-btn

Static

a static member is a member of a class that isn't associated with an instance of a class. Instead, the member belongs to the class itself. As a result, you can access the static member without first creating a class instance


1. Example for static variable and methods

1_1. static variable

Static variables are belongs to the class and not to the object


1_2. static method

Static methods are also similar to static variable


1_3. Example


2. Example for static block

Static blocks are nothing but a normal block of code, enclosed in braces {}, preceded with static keyword.

These static blocks will be called when JVM loads the class into memory. Incase a class has multiple static blocks across the class, then JVM combines all these blocks as a single block of code and executes it


2_1. Example


3. Example for static block vs constructor

Java static blocks will be called when JVM loads the class into memory, means it will be called only once. But constructor will be called everytime when you create an object. 


3_1 Example


4. Example for Singleton class using static block

Since static block will be called only once, we can use static block to develop singleton class.

To create singleton class, make constructor as private, so that you cannot create object outside of the class. Create a private static variable of same class type, so that created object will be pointed to this reference. Now create static block, and create object inside static block. Since static block will be called only once, the object will be created only once.


4_1. Example


5. STATIC import

 We can access any static fields or methods with reference to the class name. Static imports allow us to import all static fields and methods into a class and you can access them without class name reference

5_1. Source






'Back-End > Java_1' 카테고리의 다른 글

[Java] JDK, JRE, and JVM  (0) 2016.06.03
[Java] Exception  (0) 2016.05.18
[Java] Constructor  (0) 2016.05.17
[Java] Enum  (0) 2016.05.13
[Java] Array  (0) 2016.05.12
블로그 이미지

리딩리드

,
donaricano-btn

To make a tab


1. Simple HTML

- View


2. border-top, height, background

2_1. View

2_2. Source


2_3. border

- border-style : set the style of the border

- border-top : set the top border

border-top: border-width border-style border-color|initial|inherit;

- View

- Source

3. margin 0 auto

3_1. Source

- You can set the margin property to auto to horizontally center the element within its container


3_2. View

4. overflow : hidden

4_1. Source

4_2. View

4_3. Overflow

1) The overflow property specifies what to do if the content of an element exceeds the size of the element's box.


5. list-style, float

5_1. Source


5_2. View


5_3. list-style

- Specify all the list properties in one declaration

- View


5_4. float

The float property specifies whether or not a box (an element) should float.

Note: Absolutely positioned elements ignores the float property!


6. background: url, display : block, vertical-align, text-align

6_1. Source


6_2. View


6_3. background: url() repeat-x left bottom

 - repeat-y will repeat a background image only vertically.

 - repeat-x will repeat a background image only horizontally.


 6_4. display: block

- Displays an element as a block element like <p>


7. !important

- First priority


8. background-position : left top

8_1. Source


8_2. View


8_3. background-position



'Front-End > HTML5 + CSS' 카테고리의 다른 글

[HTML5] 4. HyperLink  (0) 2016.08.04
[HTML5] 3.Text Tag  (0) 2016.08.04
[HTML5] 2. Semantic for IE  (0) 2016.08.04
[HTML5] 1. Semantics Tags  (0) 2016.08.04
[CSS] heavy character  (0) 2016.02.23
블로그 이미지

리딩리드

,
donaricano-btn

Commenting and Uncommenting 

- commenting and UnCommenting

1. Ctrl + /

2. Ctrl + shift + /

'IDE > WebStorm' 카테고리의 다른 글

[WebStorm] Rename Refactoring of file  (0) 2016.04.19
[WebStorm] 1. How to set a git  (0) 2016.04.17
블로그 이미지

리딩리드

,
donaricano-btn

Screen English

Zach :  What is he doing with a bunch of kid's books?

Champ : These aren't kids books. Okay?

Kids books help you fall asleep

These books keep you up all night

Zach : Okay

Champ : R.L Stine

Whatever happened to that guy?


Zach :  그 남자는 이 많은 어린이 책들로 뭘하려고 하고 있는거지?

Champ : 이것들은 어린이 책이 아냐, 알아?

어린이 책은 잠이 잘 오게 도와주거든

근데 이책은 밤새 잠을 못자게해

Zach : 맞네

Champ : 로버트 로렌스 스타인

대체 이사람에게 무슨 일이 일어난거야?



대체 그남자에게 무슨 일이 일어난거야?

- Whatever became of him?

- How did he end up?


Kiss English

Dialogue 1

A: Is the science close

(그 과학 기술이 가까운 시기에 가능한가?)

B: We're still 10 years away from seeing this medicine

(이 약이 나오려면 아직도 10년은 더 있어야해)


Dialogue 2

A: When will you get out of the army?

(군대 언제나와)

B: I'm still two years away from discharge

(내가 제대하려면 2년은 더있어야되)


Dialogue 3

A: The construction site is huge

(공사현장이 거대하네)

B: The building's still two years away from completion

( 그 건물이 완공되려면 아직도 2년은 더 있어야해)

'English > GMP.2016' 카테고리의 다른 글

[GMP] We are not here for book club  (0) 2016.05.12
[GMP] We'll be out of your hair  (0) 2016.05.12
[GMP] That's weird  (0) 2016.05.09
[GMP] We haven't properly met  (0) 2016.05.08
[GMP] That is not fair  (0) 2016.05.08
블로그 이미지

리딩리드

,