Write lisp interpreter in java (10 implementation objects and classes)
In the process of implementing the interpreter, I found a fun thing, that is, how to better use the object-oriented idea to write code, and think about how to define a set of templates. Before starting again, I sorted out two kinds of object-oriented templates.One is a java style template(class classname (superclass) (. field) (
func t()(
...
Posted by timcapulet on Sat, 19 Feb 2022 10:59:36 +0100
java_ toString method of object class, equals method of Objects class, Date class, DateForma, Calendar class introduction, and common methods of System class_ Study notes
1, toString method of Object class
java.Lang.objectClass object is the root (parent) class of the class hierarchy.Each class (person, student...) All use object as the super (parent) class. All objects (including arrays) implement the methods of this class.
public class Person {
private String name;
private int age;
public Per ...
Posted by hpg4815 on Fri, 18 Feb 2022 08:26:09 +0100
Learning notes of javascript advanced programming | 8.2 create object
follow [front end Xiaoao] , read more original technical articles
create object
Create a single Object: Object constructor and Object literalDisadvantages: using one interface to create many objects produces a lot of duplicate code
Relevant code →
Factory mode
Create a specific interface according to a specific object creation proce ...
Posted by purencool on Thu, 17 Feb 2022 08:28:28 +0100
[J2SE]Object. Implementation of hashcode
Contents of this article
1, Basic concepts2, Implementation of hotspot
Object.hashCode()
mark wordget_next_hash(thread, obj)System.identityHashCode(obj)3, Test verification
1. After GC, the memory address of the object changes, but the hash value remains unchanged2. The hash value is saved in the mark word of the object header
1, ...
Posted by insub2 on Wed, 19 Jan 2022 21:58:01 +0100
The equals() and hashcode() methods for object comparison in Java
equals() and hashcode() in Java object comparison
1. Comparison and analysis of equals() method and "= ="
First, put forward a misunderstanding:
==Address comparison during comparisonValues are compared when equals is compared
String a = "123";
String b = "123";
System.out.println(a.equals(b)); // true
System.out.println(a == b); ...
Posted by 28rain on Tue, 18 Jan 2022 22:33:57 +0100
Several ways of creating objects in JS
preface
All objects in JavaScript are from Object; All objects from Object Prototype inherits methods and properties, which of course may be overridden. This article mainly introduces several methods of creating objects.
1. Object literal {...}
Object literal is one of the most commonly used methods, which uses curly braces containin ...
Posted by Kyrst on Wed, 12 Jan 2022 08:21:39 +0100
In depth study of java object-oriented polymorphism and internal classes
I polymorphic
1. Class polymorphism
Requirements:
Demand: teachers go to work by bike
Analysis: teachers, bicycles
Demand upgrade / iteration: Bicycle - > car
Steps:
1. Create a Car class and write start and stop
2. Write open and close based on the original Teacher class
Note: violation of OCP principles
OCP - opening an ...
Posted by Dang on Mon, 03 Jan 2022 05:31:00 +0100
Java -- API -- brief introduction and of object class
Day11—API—Object
API
summary
Application Programming Interface
Interface oriented programming - interface documentation
API development manual
On the official website
Object
summary
Package: Java lang ; Default auto guided package Class Object Class Object is the root class of the class hierarchy Each class uses Object as the supe ...
Posted by 23style on Fri, 31 Dec 2021 14:30:49 +0100
JAVA -- API -- Object String StringBuffer/StringBuilder
API introduction
API (Application Programming Interface) refers to some predefined interfaces (such as functions and HTTP interfaces), or conventions for the connection of different components of software system. It is used to provide a set of routines that application programs and developers can access based on certain software or hardwar ...
Posted by mindfield on Mon, 20 Dec 2021 12:11:42 +0100