'FINAL' KEYWORD IN JAVA

‘Final’ keyword represents ‘ultimate’ and ‘unchangeable’. In this post, I will talk about four usages of the ‘final’ keyword, including modifying a class, a method, local variables (basic and reference types) and a member variable.

JAVA POLYMORPHISM

In this post, I will talk about the concepts and benefits of polymorphism. Then, I will point out some important properties about using class variables and methods when polymorphism happens. Moving on, object down casting and ‘instanceof’ method will be briefly introduced. Finally, I will demonstrate a case study combining the knowledge of using interface and polymorphism.

C# CLASS AND NAMESPACE

This post is the beginning of my journey for learning C#. I will start with the very first program ‘Hello World’ to illustrate the concepts of class and namespace. And then, I will briefly talk about the reference of class libraries which consists of DDL and project reference. In the end, I will clarify the definition of a good program which should have high cohesion and low coupling.

JAVA INTERFACE

An interface is a reference type in Java. It is similar to class. It is a collection of abstract methods. A class implements an interface, thereby inheriting the abstract methods of the interface. Along with abstract methods, an interface may also contain constants, default methods, static methods, and nested types (TutorialsPoint 2022).

MYSQL COMMANDS

MySQL是一种关系型数据库管理系统,其将数据保存在不同的表中,增加了速度与灵活性。MySQL所使用的SQL语言是用于访问数据库的最常用的标准化语言,由于其体积小、速度快、总体拥有成本低,一般中小型和大型网站的开发都选择MySQL作为网站数据库。此博文将会记录笔者学习MySQL的全过程,其中包括了MySQL知识的总结归纳与个人的思考启发。对于MySQL的学习,笔者决定从bilibili上的黑马程序员教学视频(MySQL数据库入门到精通,从mysql安装到mysql高级、mysql优化全囊括)入手(嘿嘿^^打个广告,黑马程序员yyds),该教学视频由浅入深,对于初学者及其友好。读者亦可将此博文作为MySQL速查表,以便于快速查找MySQL命令。

SMART POINTERS IN C++

在C++中,动态内存的管理依赖于 new 和 delete 关键字。当程序员想要在堆(heap)上为对象分配空间并返回一个指向该对象的指针时,可以使用 new 关键字进行,同时也可以利用该类的构造函数(constructor)对其进行初始化(initialization)。当动态对象不再需要被使用时,我们可以使用 delete 关键字销毁该对象,并释放与之关联的内存。使用动态内存容易造成错误,当我们忘记释放内存或者不小心丢失了指向该内存的指针时,内存泄漏(memory leak)便会发生。为了更加方便地使用和管理动态内存,基于类模版的智能指针便应运而生。顾名思义,智能指针的行为类似于常规指针,但其可以智能地释放所指向的对象,避免造成内存泄漏。

Thumbnail image

PROFILE