Java 정리 1

2021. 1. 14. 21:50·JAVA
728x90
반응형

progate.com/dashboard

 

Progate | Learn to code, learn to be creative.

Progate is an online platform to learn programming. Learn to build your own apps and services.

progate.com

프로게이트에서 자바 강의를 듣고 있다.

이론과 예시를 간단하게 슬라이드로 보여준 후, 바로 직접 코드를 짤 수 있는 예제가 주어져서 부담없이 공부하기 쉽다.

 

총 6개의 단계로 나눠져 있으며 내 기억으로는 3단계 이후부터는 멤버십을 가입해야 볼 수 있었다.

프로게이트 플러스 멤버십은 달에 $9.99 정도. 자바 외에도 다른 언어가 많아서 조금 더 들어볼 것 같다.

 

영어로 설명하긴 하지만 굳이 사전을 찾아볼 필요 없이 초간단한 영어만 쓰이니 걱정할 필요도 없고, 개발에 있어서 구글링은 필수이기 때문에(...) 영어 공부도 겸하기에 좋은 것 같다.

매일 강의를 들으며 필기한 것을 정리해 올릴 예정.

 


 

"Hello Java" print charachers

class Main {
    public static void main(String[] args) {
        System.out.println("Hello Java");
    }
}
Colored by Color Scripter
cs

 

System.out.println( ) is an instruction to print what's inside ( ).

Every Java file has a class. Inside the class, there are methods.

Semicolon at the end of every statement.

주석 달 때는 " // " 사용

 

Integers no need " "

ex) print the sum of  5 and 3

-> System.out.println( 5 + 3 );

print "5 + 3" as a string

-> System.out.println("5 + 3");

 

String concatenation

The + that we used for calculations also let us combine strings.

Data type

- String type ("S" must be uppercase)    ex) "Hello Java"

- int type    ex) 3

 

Declaring variables

1. Specify the data types

2. Decide the name

ex) int number;

String name;

 

Assigning values     

Initializing variables : declare and assign at the same time

dataType variableName = value

ex ) int number = 3;

System.out.println( number );    ->  3

 

Concatenating variables

ex) String greeting = "Hello";

System.out.println(greeting + "John");        ->  Hello John

 

Good variable name : lowercase, seperate the words with a capital letter   ex) userName

Bad variable name : Don't start with a number, Don't use underscore    ex) user_name

 

When we do calculations with an int and a double, int will be implicitly converted to a double.

You can convert an integer to a double by casting it.

ex ) int number1 = 13;

int number2 = 4;

System.out.println( (double) number1 / number2 );   -> 3.25

 

 

출처 : progate.com/dashboard

728x90
반응형
저작자표시 비영리 변경금지 (새창열림)

'JAVA' 카테고리의 다른 글

Java 정리 4  (0) 2021.01.19
Java 정리 3  (0) 2021.01.18
JAVA 정리 2  (0) 2021.01.15
'JAVA' 카테고리의 다른 글
  • Java 정리 4
  • Java 정리 3
  • JAVA 정리 2
waVwe
waVwe
    반응형
  • waVwe
    waVwe 개발 블로그
    waVwe
  • 전체
    오늘
    어제
    • ALL (184)
      • Python (1)
      • Spring (15)
      • DevOps (10)
      • Git (6)
      • JAVA (4)
      • C (22)
      • 코테 문제 풀이 (124)
        • 프로그래머스 (43)
        • 백준 (2)
        • 정올 (64)
        • SW Expert Academy (1)
        • 온코더 oncoder (14)
  • 블로그 메뉴

    • 홈
    • 방명록
  • 링크

    • 🐙 Github
  • 공지사항

  • 인기 글

  • 태그

    자바
    깃헙
    내일배움캠프
    이진트리
    while문
    C
    깃
    형변환
    아파치카프카
    코테
    프로그래머스
    devops
    docker
    알고리즘
    springboot
    java
    정올
    스파르타코딩클럽
    도커
    연결리스트
    MSA
    CI/CD
    스프링부트
    자료구조
    스파르타코딩
    progate
    스프링
    Til
    C언어
    온코더
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.0
waVwe
Java 정리 1
상단으로

티스토리툴바