直接输出对象如图: 方法的原理: 代码: 子类:所有类的直接或间接的继承Object类,如果类中没有extends,其实它是默认extends Object类,不过是省略不写而已。 public class Student { String name; int age; public Student ...
分类:
编程语言 时间:
2021-03-02 12:02:25
阅读次数:
0
public class demo5 { public static void main(String[] args) { int a = 10; int b = 20; a+=b;//a = a+b a-=b;//a = a-b System.out.println(a); //字符串连接符 Sy ...
分类:
其他好文 时间:
2021-03-02 11:50:18
阅读次数:
0
$"[Id] NOT IN ('{string.Join("','", data.Details.Select(q => q.Id.ToString()))}')" ...
分类:
编程语言 时间:
2021-03-02 11:47:41
阅读次数:
0
using System; using System.Text.RegularExpressions; public partial class RegexEx { /// <summary> /// 验证输入字符串是否与模式字符串匹配,匹配返回true /// </summary> /// <pa ...
分类:
其他好文 时间:
2021-03-02 11:46:45
阅读次数:
0
public static void main(String[] args) { int num1 = 10_0000_0000; int rate = 20; long total = num1 * rate; System.out.println(total);// 输出为-1474836480 ...
分类:
其他好文 时间:
2021-03-01 14:18:24
阅读次数:
0
一、题目描述 输入一个英文句子,翻转句子中单词的顺序,但单词内字符的顺序不变。为简单起见,标点符号和普通字母一样处理。例如输入字符串"I am a student. ",则输出"student. a am I"。 示例 1 输入: "the sky is blue"输出: "blue is sky ...
分类:
其他好文 时间:
2021-03-01 14:16:17
阅读次数:
0
public class demo4 { //逻辑运算符 public static void main(String[] args) { //与(&&)或(||)非(!) boolean a = true; boolean b = false; System.out.println(a && b) ...
分类:
其他好文 时间:
2021-03-01 14:15:22
阅读次数:
0
不可变对象想必大部分朋友都不陌生,大家在平时写代码的过程中100%会使用到不可变对象,比如最常见的String对象、包装器对象等,那么到底为何Java语言要这么设计,真正意图和考虑点是什么?可能一些朋友没有细想过这些问题,今天我们就来聊聊跟不可变对象有关的话题。 以下是本文目录大纲: 一.什么是不可 ...
分类:
编程语言 时间:
2021-03-01 14:06:13
阅读次数:
0
地址 https://leetcode-cn.com/problems/string-to-url-lcci/solution/ URL化。编写一种方法,将字符串中的空格全部替换为%20。假定该字符串尾部有足够的空间存放新增字符,并且知道字符串的“真实”长度。(注:用Java实现的话,请使用字符数组 ...
分类:
Web程序 时间:
2021-03-01 13:58:11
阅读次数:
0
队列,先进先出 Queue<string> q = new Queue<string>(); q.Enqueue("A"); q.Enqueue("B"); q.Enqueue("C"); Console.WriteLine(q.Dequeue()); //移除第一个并返回第一个元素的值:A Con ...