Skip to main content

Posts

Showing posts from May, 2025

Object is Correct?

 Object is Correct? Hi!! I’m Ogata. Today, I tell you about the Object. With Python, I tell you. This is very simple code. a=input() 2344 a >>’2344’ This is almost a shell command. In Python IDLE, you create a variable a. Moreover, you compare it to a a. >>2344 is a What would be the next? The answer is… >>False What!? I put it in a!! Yet, that is wrong. Why? Do you explain this phenomenon? The input() method is just String. So, the casting method of int would be need. At the first time, not just a input() method, but also a int casting. Like this, a=int(input())!! Then, you can get correct number type. However, that number object is not 2344. Because how to be created of is different. As that, object comparing is false. Do you understand it? This is complex parts in Python or Programming. OK. Today, I...

temp algorithm

Do you know temp? This script is very easy one. temp = a a = b b = temp This is major algorithm. The exchange algorithm. Why is a=b, and b=a bad? The a is a. The a=b process is that a is changed by b. So, a is not a. After that, insert a value to b, just b can be b. Thus, we use temp variable. The temp is a memory cage. The a’s memory cage. Just it. Do so, you can exchange the value of a and b. Do you know it? Thanks. That’s it.

The power of Interface in Java

  Hi ! I’m Ogata. Today, I show you how we can use interface of Java. Java is programming language. It’s very major. Plus, it’s OOP language. OOP is the Object Oriented Programming. And so, today, I show you interface power of reuse points. Look at this script. This is very easy script. The constructor is used GetCar class. If you don’t know constructor, you study it by another book. Points are two. To call constructor is in main method, and numbers of 2, 1 are used. However, at printline call, just used it with carSize.getFoo(). The carSize is variable. The getFoo method is interface’s abstract method name. If you want to call this method of the other implemented class, You use this by the same name. For example, carVolume.getFoo(). This is same pattern and the same how to write. This is power of Interface of Java. You know about it? It’s incredible things. Since I notice this, I’m very moved by Java programming. ...