Kuby Block

Blog about programming, tech, society and more.

Posts

  • Primitive type in java

    Definition: Any data-type built-into a programing language is called primitive data type. Basic behavior of a primitive data type itself, however, cannot be changed. There are 8 primitive data types in java. They are as follow: 1. byte byte: The byte data type is an 8-bit signed two’s complement integer. It has a minimum value of -128 and a maximum value of 127 (inclusive). The byte data type ...

  • Mess with polymorphism

    Definition: Polymorphism is one of four main concepts of Object Oriented Programming (OOP). In common, a parent interface defines common methods, then will be specify by children class. So although they have the same type, but each specific entity will do a method with different ways. How to implement: overloading overriding We have some scenarios: We have some method with the same name...

  • Overloading versus Overriding

    Overloading and overriding are two important concepts, not only in java language but in programming too. Definitions Overloading is concept about the methods have the same method name but different parameters. It is not just in class (Object Oriented Programming - OOP), but in any programing language. Overriding is concept about the methods have the same method name and parameters as well. ...

  • Package class files to jar library file

    Reuse java classes When programming, reuse a class, a module or a method is not rarely. If it simple and short, we can rewrite it, or copy it. But it is long and complex, we couldn’t spend a lot of time to rewrite a class - which we have written before. We can copy the whole files from this project to another project, but it will be bulky and raise some issues how to put it in. That is, we can do ...

  • Invoke a function and some more

    Declare a function Declare a function to use in this post function info(firstname, lastname, age){ console.log(firstname); console.log(lastname); console.log(age); } Popular way As you know, we can invoke a function with syntax function_name(arg1, arg2). In our example, it will be: info("Rick", "Thomas", 30); // Output: // Rick // Thomas // 30 What happen if we leave empty the final argu...

subscribe via RSS