-
[JAVA]05. Java
JAVA Lesson 5: Intellij and Debugging JDK JDK: Java Development Kit JRE: Java Runtime Environment javac: A Java Compiler How to build java Verify that you have java open a terminal window and type ***java -version I’m studying a “Java Programming Basics” @Udacity.
-
[JAVA]04. Loops
JAVA Lesson 4: Loops While Loops public void alarm() { boolen on = checkAlarm(); if(on){ beep(); on=checkAlarm(); } if(on){ beep(); on=checkAlarm(); } if(on){ beep(); on=checkAlarm(); } ---//until someone turn off the alarm } /*Using While Loop*/ public void alarm(){ boolean on = checkAlarm(); while(on){ beep(); on = checkalarm(); } } String googol = '1'; int len = googol.length(); while(len <101){ googol = googol + "0"; len= googol.length(); } public void raiseAlarm(int numOfWarnings) { int i...
-
[JAVA]03. Functions
JAVA Lesson 3: Functions Function What is a Fuction? Organize and group code Perform a specific task Function definition Contains the code a finction executes Calling a function is equivalent to execution the cide in the definition public void chorus() { if(playButton){ } else{ } } public : access modigier void : return type function name : how ew call our function ex)chorus is function name at that code Function Calling public void chorus() {...
-
[JAVA]02. Control Flow
JAVA Lesson 2: Control Flow Basic how to make a good decision? if Statement boolean isRaining = true; if(isRainging){ //if isRaining true, operate this scope System.out.println("Close the window"); } //if not nothing else Statement boolean isRaining = true; if(isRaining){ System.out.println("Close the window"); } else{ System.out.println("It's Sunny outside"); } else-if Statement int passcode = 555; String coffeeType; if(passcode == 555) { coffeeType = "E"; } else if(passcode == 312) { coffeeType = "V"; } else if(passcode...
-
[JAVA]01. Variables and Data Types
JAVA Lesson 1: Variables and Data Types Basic System.out.println(); System —> System command Out —> output Println —> print a line Java is case sensitive Quotation marks display the message as is Semi-colon means end of statement Variables Integer /* Interger --> int */ int passengers; // declare passengers = 0; // initialize passengers = passengers +5; passenger = passengers -3; passenger = passenger -1 +5; System.out.println(passengers); // answer is 6 Also track multiple integers...