πŸ“—
JunegLee's TIL
  • TIL
  • python
    • class
    • String Basic
    • regularExpression
    • String function
    • Generator
    • String format
    • getset
    • module
    • while
    • numpy
    • print()
    • matplotlib
    • for
    • Boolean
    • tuple
    • package
    • input(variable)
    • list
    • if
    • file
    • type()
    • pandas
    • function
    • dictionary
    • ꡬ문 였λ₯˜μ™€ μ˜ˆμ™Έ
    • builtinFunction
    • Constructor
  • algorithm
    • sort
      • mergeSort
      • insertionSort
      • bubbleSort
      • heapSort
      • quickSort
      • selectionSort
    • recursion
    • Greedy
    • DepthFirstSearch
    • basic
      • DataStructure
    • hash
    • BreadthFirstSearch
  • tensorflow
    • keras
      • layers
        • Flatten
        • Flatten
        • Dense
        • Dense
        • Conv2D
        • Conv2D
    • tensorflow1x
    • tensorflow2x
  • DB
    • setting
    • join
    • subQuery
    • overview
  • deep-learning
    • neuralNetwork
    • perceptron
    • neuralNetworkLearning
    • convolution neural network
    • Gradient Descent
    • Linear Regression
    • backPropagation
    • logistic regression
    • overview
  • textPreprocessing
    • overview
  • java
    • basics
      • generic
      • Variable
      • String
    • theory
      • Object Oriented Programing
  • NLP
    • Embedding
    • Natural Language Processing
Powered by GitBook
On this page
  • λ³€μˆ˜ (Variable)의 μ •μ˜
  • μžλ°”μ˜ κΈ°λ³Έν˜• (Primitive type)
  • λ³€μˆ˜μ˜ μ €μž₯
  • λ³€μˆ˜μ˜ λͺ…λͺ… κ·œμΉ™(Naming convention)

Was this helpful?

  1. java
  2. basics

Variable

λ³€μˆ˜ (Variable)의 μ •μ˜

: ν•˜λ‚˜μ˜ 값을 μ €μž₯ν•  수 μžˆλŠ” 기얡곡간(λ©”λͺ¨λ¦¬ 곡간)

λ©”λͺ¨λ¦¬ μ’…λ₯˜(νƒ€μž…)

λ©”λͺ¨λ¦¬ 별λͺ…(λ³€μˆ˜)

[Data type]

[Variables]

ex) int

ex) i

κΈ°λ³Έν˜• (Primitive type)

μ°Έμ‘°ν˜• (Reference type)

8개 (byte, short, int, long, char, boolean, float, double) μ‹€μ œ 값을 μ €μž₯

κΈ°λ³Έν˜•μ„ μ œμ™Έν•œ λ‚˜λ¨Έμ§€(String, Thread) λ‹€λ₯Έ λ©”λͺ¨λ¦¬μ˜ μ£Όμ†Œλ₯Ό μ €μž₯ν•˜λŠ” λ³€μˆ˜

μžλ°”μ˜ κΈ°λ³Έν˜• (Primitive type)

1Byte (8bit)

2Byte( 16bit)

4Byte (32bit)

8Byte (64bit)

λ…Όλ¦¬ν˜•

boolean

λ¬Έμžν˜•

char

μ •μˆ˜ν˜•

byte

short

int

long

μ‹€μˆ˜ν˜•

float

double

λ³€μˆ˜μ˜ μ €μž₯

int score; // λ³€μˆ˜ μ„ μ–Έ
score = 90;  // 값을 μ €μž₯
int score = 90;  // λ³€μˆ˜ μ„ μ–Έκ³Ό λ™μ‹œμ— 값을 μ €μž₯

μ—¬λŸ¬ 개의 λ³€μˆ˜ μ„ μ–Έκ³Ό κ°’ μ΄ˆκΈ°ν™” μ‹œν‚€κΈ°

int i = 100, j, k = 300;

μƒˆ κ°’μœΌλ‘œ λ³€κ²½

int = i;
i = 100;
i = 200;

λ³€μˆ˜λŠ” μ‚¬μš©μ „μ— λ°˜λ“œμ‹œ μ„ μ–Έ

i = 100; // 컴파일 였λ₯˜
int i, j; 
j = 200; // μƒˆ κ°’μœΌλ‘œ λ³€κ²½λœλ‹€
  • λ³€μˆ˜λŠ” μ„ μ–Έλœ 블둝 λ‚΄μ—μ„œλ§Œ μ‚¬μš©μ΄ κ°€λŠ₯ν•˜λ‹€

  • λ³€μˆ˜λŠ” μ€‘κ΄„ν˜Έ {} 블둝 λ‚΄μ—μ„œ μ„ μ–Έλ˜κ³  μ‚¬μš©λ˜λ©°, λ©”μ„œλ“œ 블둝 λ‚΄μ—μ„œλ„ 여라가지 μ€‘κ΄„ν˜Έ {} 블둝듀이 μžˆμ„ 수 있기 λ•Œλ¬Έμ—,

    μ–΄λ–€ λ²”μœ„μ—μ„œ μ‚¬μš©λ  것인지 μƒκ°ν•˜κ³ , μ„ μ–Έ μœ„μΉ˜λ₯Ό κ²°μ •ν•΄μ•Ό ν•œλ‹€.

λ³€μˆ˜μ˜ λͺ…λͺ… κ·œμΉ™(Naming convention)

  1. λŒ€μ†Œλ¬Έμžκ°€ κ΅¬λΆ„λ˜λ©° 길이에 μ œν•œμ΄ μ—†λ‹€

    • True와 trueλŠ” μ„œλ‘œ λ‹€λ₯Έ κ²ƒμœΌλ‘œ κ°„μ£Όλœλ‹€

  2. μ˜ˆμ•½μ–΄ (Reserved Word)λ₯Ό μ‚¬μš©ν•΄μ„œλŠ” μ•ˆλœλ‹€.

    • true λŠ” μ˜ˆμ•½μ–΄λΌ μ‚¬μš©ν•  수 μ—†μ§€λ§Œ, TrueλŠ” κ°€λŠ₯ν•˜λ‹€

  3. 숫자둜 μ‹œμž‘ν•΄μ„œλŠ” μ•ˆλœλ‹€.

  4. νŠΉμˆ˜λ¬ΈμžλŠ” β€˜_’ 와 β€˜$β€™λ§Œμ„ ν—ˆμš©ν•œλ‹€

PreviousgenericNextString

Last updated 4 years ago

Was this helpful?