一.常量 1.常量的定义:final修饰的实例变量是不可变的,这种变量一般和static联合使用,被称为“常量” 2.常量的语法格式: public static final 类型 常量名 = 值: java规范中要求所有常量的名字全部大写,每个单词之间使用下划线连接 package com.bjpowernode.java_learning; public class D49_Constant { public static void main(String[] args) { System.…
Yuanfang is puzzled with the question below: There are n integers, a 1, a 2, -, a n. The initial values of them are 0. There are four kinds of operations. Operation 1: Add c to each number between a x and a y inclusive. In other words, do transformat…
遇到error: Error: No resource found for attribute 'layout_scrollFlags' in package'包名' 这个问题时候刚開始自己也是感觉到奇怪,错误也即是下图 处理方法:就是把xmlns:app="http://schemas.android.com/apk/res-auto" 把res-auto换成自己的包名.不让它自己适应了,换成详细的. 换了之后报错就消失了 看下图 自己的报名就创建项目的时候的包名字.记不住的能够到A…
scala 面向对象之 继承 scala 1.extends Scala中,让子类继承父类,与Java一样,也是使用extends关键字 继承就代表,子类可以从父类继承父类的field和method:然后子类可以在自己内部放入父类所没有,子类特有的field和method:使用继承可以有效复用代码 class Person { private var name = "leo" def getName = name } class Student extends Person {…