Java
-
Inheritance and PolymorphismJava 2022. 2. 9. 21:23
자바의 상속과 다형성에 대해 정리하였습니다. Introducing Inheritance >Java class can inherit traits from another class.The object-oriented principle of inheritance saves us the headache of redefining the same class members all over again. Parent class, superclass, and base class refer to the class that another class inherits from.Child class, subclass, and derived class refer to a class that inherits from another ..
-
Static Variables and MethodsJava 2022. 2. 9. 14:16
자바의 Static한 변수와 메소드에 대해 정리하였습니다. Static methods are methods that belong to an entire class, not a specific object of the class. Static methods are called using the class name and the . operator. Example) double randomNumber = Math.random(); // Stores a random decimal between 0.0 and 1.0 in randomNumber double number = Double.valueOf("2.5"); // Transforms the String "2.5" into ..
-
Math MethodsJava 2022. 2. 8. 21:24
자바에서 주로 쓰이는 숫자 메소드들에 대해 정리하였습니다. The Java Math class is part of the java.lang package which is available by default; it contains a variety of methods that can be used to perform numerical calculations in our programs. Every method in the Math class is static. This means that we can call and use these methods without creating an object of the class. The..
-
Access, Encapsulation, and ScopeJava 2022. 2. 8. 20:46
자바의 Access와 Scope개념에 대해 정리하였습니다. As our Java programs begin to get bigger and we begin to have multiple Objects and Classes that interact with each other, the concepts of access and scope come into play. Access The public and private keywords and how they relate to Classes, variables, constructors, and methods The concept of encapsulation Accessor methods, sometime..
-
String MethodsJava 2022. 2. 7. 22:40
자바에서 주로 쓰이는 문자열 메소드들에 대해 정리하였습니다. String is an object that represents a sequence of characters. Because character strings are so vital to programming, Java assigned an entire class to them. String class has a lot of useful methods to help us. We don't have to import anything to use the String class because it's part of the java.lang package which is available by default. < lengt..
-
LoopsJava 2022. 2. 7. 21:11
자바의 반복문에 대해 정리하였습니다. To repeat the same block of code until some condition is met. We employ loops to easily scale programs - saving time and minimizing mistakes. Writing the same code over and over is time-consuming. Having less code means having less to debug. while (condition) { // code block } If the condition evaluates to true, the code block will run. ..
-
ArrayListsJava 2022. 2. 6. 16:30
자바의 ArrayList에 대해 정리하였습니다. When we work with arrays in Java, we’ve been limited by the fact that once an array is created, it has a fixed size. We can’t add or remove elements.But with ArrayList, we can create mutable and dynamic lists. ArrayList allow us to:Store object references as elementsStore elements of the same type (just like arrays)Access elements by index (just like arrays)Add elemen..
-
ArrayJava 2022. 2. 5. 19:42
자바의 배열에 대해 정리하였습니다. To store a group of data You can think of array as List in real life. DataType[] VariableName = {element1, element2, element3, ...}; Array is represented by [ ] DataType : the type of data it holds. element : Each content item inside an array. Example) double[] prices = {13.15, 15.87, 14.22, 16.66}; String[] clothingItems = {"Tank Top", "Beanie", "..