Tag:generic paradigm

  • Android Foundation Series (1) Java generics


    sketch Java generics is a new feature introduced in j2se1.5. Its essence is parameterized type. That is to say, the operated data type is specified as a type parameter. This parameter type can be used in the creation of classes, interfaces and methods, which are called generic class, generic interface and generic method respectively.Let’s understand […]

  • Gson of Java source code analysis


    1: To the official website, the main function of gson is the mutual conversion between Java objects and JSON. Let’s take a look at the simplest example @AllArgsConstructor public static class Book{ private Integer id; private String name; } public static void main(String[] args) { Map<String,Book> map = Maps.newHashMap(); map.put(“1″, new Book(1,”1”)); map.put(“2″, new Book(2,”2”)); […]

  • A detailed explanation of dart grammar


    If you want to learn flutter, please pay attention to this columnFlutter series (1) — a detailed introductionFlutter series (2) — comparison with react nativeFlutter series (3) — environment building (Windows)Flutter series (4) — HelloWorldA detailed explanation of dart language (1) — a detailed introductionA detailed explanation of dart language (2) — basic grammarA detailed […]

  • Upgrade user experience through. Net nativeaot


    preface TypedocConverterIt’s a project that I started earlier because I helped to maintain the Monaco editor uwp, but because there are too many APIs in the Monaco editor, it’s not cost-effective to write the type binding of C #. This tool can directly generate the corresponding C # type binding code from the JSON file […]

  • Out and in in kotlin language


    PS: read the original, you can get the source code In kotlin language, out means covariance and in means inversion; Covariance and inversion are not unique concepts of kotlin, such as Java and C #; In order to understand the out and in of kotlin, let’s use Java generics as an example. We need to […]

  • Will Arts Week 2 | leetcode 31 | go support value methods and pointer methods in generics | go


    ARTS Arts is an activity launched by Chen Hao in the geek time column. The purpose is to keep learning through sharing. Each person writes an arts every week: algorithm is an algorithm problem, review is to read an English article, technology / tips is to share a small technology, share is to share a […]

  • 010 drop check of rust Necromancer


    introduce The video recorded in this series is mainly on station BRust necromancer learning video The source code of rust is as follows:github.com/anonymousGiga Note content A piece of code struct Inspector<‘a>(&’a u8); struct World<‘a> { inspector: Option<Inspector<‘a>>, days: Box<u8>, } fn main() { let mut world = World { inspector: None, days: Box::new(1), }; world.inspector […]

  • Review Java generics, take you more in-depth understanding of it, better use it!


    1. Introduction Java generics are introduced in jdk5.0 to reduce errors and add an extra abstraction layer to the types.This article will briefly introduce generics in Java, the goals behind generics, and how to use generics to improve the quality of code. 2. Why use generics? Imagine a scenario where we want to create a […]

  • Trust learning: generics data types


    We can use generics to create definitions for items such as function signatures or structures, which can then be used for many different concrete data types. First, let’s look at how to use generics to define functions, structures, enumerations, and methods. Then we’ll discuss how generics affect code performance. In function definitionFor example, if we […]

  • Java Basics: a deep understanding of generics


    1. Java generics 2. How to implement Java generics? Java generics are implemented throughType Erasure It’s true! That is, Java generics are pseudo generics. During compilation, all generics information will be erased. Therefore, the java compiler will find possible errors as much as possible at compile time, but it still can’t find the type conversion […]

  • Dart tutorial 03 – classes, generics


    We learned in the first partDart tutorial 02 – control flow, exceptionNow let’s move on to classes and generics in dart. Class Here are the methods to declare a simple class in dart and create an instance of it. Add instance variables and constructors to the class Dart provides a concise syntax for constructor initialization. […]

  • What is the function of Java lambda learning notes


    Don’t talk about the source code 1. Main method public static void main(String[] args) { Function<String, Integer> s = Integer::parseInt; s.apply(“10”); } Let’s look at the next section 2. Decompile javap -v -p StreamTest give the result as follows Warning: the binary streamtest contains com.cui.subject . java.function.StreamTest Classfile /E:/WorkSpace/subject/java/target/classes/com/cui/subject/java/function/StreamTest.class Last modified 2020-6-15; size 1311 bytes […]