Class and instant part2

As a premise

There are two types of methods ・ What is prepared in Ruby (gets / puts / chomp / to_i etc.) ・ What you make yourself Divide into

class

An image of what kind of program to make ·name of the class ・ Class method ・ Class variables Let's think separately (I couldn't distinguish)

When creating a class method Can be used when repeating common processing or counting up

instance

Since instance variables are processed individually Instance creation is created when you want to process individually sorted

self./@/@@/initialize

self. → Class method

@ → Instance variable

@@ → Class variables

initialize → Here is where you want to make initial settings

Recommended Posts

Class and instant part2
Class and model
abstract (abstract class) and interface (interface)
java.util.Optional class and null and not null
Java and Iterator Part 1 External Iterator
Java class definition and instantiation
Apache Hadoop and Java 9 (Part 1)
Forge Modding 1.12.2 Part1 -Base class
Difference between class and instance
Difference between interface and abstract class
Get TypeElement and TypeMirror from Class
StringBuffer and StringBuilder Class in Java
Internal class and lambda study notes
Differences between Applet class and JApplet class
Java beginner escape boot camp Part 1 Java class structure and how to write
Kotlin Class part.2 to send to Java developers
Spring with Kotorin --2 RestController and Data Class
[Java] Differences between instance variables and class variables
[Java] Inheritance and structure of HttpServlet class
Java programming (static clauses and "class variables")
Creating a matrix class in Java Part 1