class

java 内部类(摘抄自网络)

放肆的年华 提交于 2020-03-08 07:46:23
Java内部类 1、内部类分为成员内部类、静态嵌套类、方法内部类、匿名内部类。 几种内部类的共性: A、内部类仍然是一个独立的类,在编译之后会内部类会被编译成独立的.class文件,但是前面冠以外部类的类命和$符号。 B、内部类不能用普通的方式访问。内部类是外部类的一个成员,因此内部类可以自由地访问外部类的成员变量,无论是否是private的。 2、 成员内部类 形式如下: class Outer { class Inner{} } 编译上述代码会产生两个文件:Outer.class和Outer$Inner.class。 成员内部类内不允许有任何静态声明!下面代码不能通过编译。 class Inner{ static int a = 10; } 能够访问成员内部类的唯一途径就是通过外部类的对象! A、从外部类的非静态方法中实例化内部类对象。 class Outer { private int i = 10; public void makeInner(){ Inner in = new Inner(); in.seeOuter(); } class Inner{ public void seeOuter(){ System.out.print(i); } } } 表面上,我们并没有创建外部类的对象就实例化了内部类对象,和上面的话矛盾。事实上

Unsupported major.minor version 49.0

爷,独闯天下 提交于 2020-03-08 05:14:29
在Eclipse 3.2 + MyEclipse 5.0 中编译的class文件,发布到WebSphere Application Server 6.0中。 报错: Error 500: java.lang.LinkageError: LinkageError while defining class: xxxx Could not be defined due to: xxxxxx (Unsupported major.minor version 49.0) This is often caused by having a class defined at multiple locations within the classloader hierarchy. Other potentia causes include compiling against an older or newer version of the class that has an incompatible method signature. 经查,是WebSphere 6.0不支持JDK1.5。 没有办法,修改Eclipse的JDK配置: 在IDE中,打开Windows--->Preferences,选择Java--->Compiler,设置“Compiler compliance setting”为1

Unsupported major.minor version 49.0

ぐ巨炮叔叔 提交于 2020-03-08 05:13:46
在Eclipse 3.2 + MyEclipse 5.0 中编译的class文件,发布到WebSphere Application Server 6.0中。 报错: Error 500: java.lang.LinkageError: LinkageError while defining class: xxxx Could not be defined due to: xxxxxx (Unsupported major.minor version 49.0) This is often caused by having a class defined at multiple locations within the classloader hierarchy. Other potentia causes include compiling against an older or newer version of the class that has an incompatible method signature. 经查,是WebSphere 6.0不支持JDK1.5。 没有办法,修改Eclipse的JDK配置: 在IDE中,打开Windows--->Preferences,选择Java--->Compiler,设置“Compiler compliance setting”为1

Matlab 中类的定义

强颜欢笑 提交于 2020-03-07 21:54:45
文章目录 1. 语法 2. 说明 2.1 classdef 代码块 2.1.1 ClassAttributes 2.1.2 SuperClass 2.2 Properties 代码块 2.3 Methods 代码块 2.4 Events 代码块 2.5 Enumeration 类 在 Matlab 中定义一个名为 classname 类,需要在类名之前用 classdef 关键字来声明,并以 end 结束类的定义。 classdef 语句之前除了空行和注释不能有其它代码,代码需要保存在与类名相同的 m 文件中,即 classname.m 文件。 定义类的文件可以放在 MATLAB 搜索路径下的文件夹中,也可以放置在搜索路径文件夹内的类文件夹。类文件夹的名字以 @ 开头,加上类的名字(如 @myclass)。更多信息参考 Class Files and Folders . 1. 语法 classdef classname properties PropName end methods methodName end events EventName end enumeration EnumName end end 2. 说明 MATLAB 以代码块来组织类的声明与定义,下面分别介绍。 2.1 classdef 代码块 参考链接 classdef 代码块内包含了类定义的全部元素

js实现无限瀑布流

て烟熏妆下的殇ゞ 提交于 2020-03-07 08:30:51
瀑布流 是一种常见的网页布局方式,在许多网站中我们都能看到“瀑布流”的效果,其特征是有网页视窗有多个高度不同宽度相同的“块”组成。因其样式酷似飞流直下的瀑布, 故将这种布局方式称为瀑布流。 生活中瀑布流实例: 花瓣网 在css中我们学习过使用Multi-columns来实现瀑布流的效果 通过 Multi-columns 相关的属性 column-count 、 column-gap 配合 break-inside 来实现瀑布流布局。 现在,我来介绍一下如何通过js方式来实现瀑布流 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style> .cont{ margin: 0 auto; position: relative; } .box{ float: left; padding: 6px; } .imgbox{ border: 1px black solid; border-radius: 6px; padding: 6px; } .imgbox img{ width: 200px; display: block; } </style> <script> onload = function () { new Waterfall(); }; function

Linux下/proc和/sys详解

天涯浪子 提交于 2020-03-06 09:07:04
概要: /proc 正在运行的内核信息映射 主要输出: 进程信息 内存资源信息 磁盘分区信息等等 /sys 硬件设备的驱动程序信息 一、 /proc 文件系统 /proc下文件基本都是只读的,除了/proc/sys目录,它是可写的(查看和修改内核的运行参数) /proc下数字命令的目录就是对于PID的进程目录 /proc/cmdline 启动时传递给kernel的参数信息(就是bootargs信息) /proc/cpuinfo cpu的信息 /proc/crypto 内核使用的所有已安装的加密密码及细节 /proc/devices 已经加载的设备并分类 /proc/dma 已注册使用的ISA DMA频道列表 /proc/execdomains Linux 内核当前支持的execution domains /proc/fb 帧缓冲设备列表,包括数量和控制它的驱动 /proc/filesystems 内核当前支持的文件系统类型 /proc/interrupts x86架构中的每个IRQ中断数 /proc/iomem 每个物理设备当前在系统内存中的映射 /proc/ioports 一个设备的输入输出所使用的注册端口范围 /proc/kcore 代表系统的物理内存,存储为核心文件格式,里边显示的是字节数,等于RAM大小加上4kb /proc/kmsg 记录内核生成的信息,可以通过/sbin

C# card shuffle in card deck 52 cards

自古美人都是妖i 提交于 2020-03-06 04:24:29
问题 there is a project for Windows application that I'm still working on and is about a set of card deck. The application utilizes 52 cards which consist of 4 suits and 13 face values such as 2 of Clubs, Jack of Hearts, and so forth. The part that I'm working is that I also have to use five pictureboxes to display each random card so I click on a "Deal" button. I'm aware that I would have to use a "Random" keyword along with using a for-loop to do the shuffle. Therefore, I'm not too sure how

C# card shuffle in card deck 52 cards

佐手、 提交于 2020-03-06 04:24:27
问题 there is a project for Windows application that I'm still working on and is about a set of card deck. The application utilizes 52 cards which consist of 4 suits and 13 face values such as 2 of Clubs, Jack of Hearts, and so forth. The part that I'm working is that I also have to use five pictureboxes to display each random card so I click on a "Deal" button. I'm aware that I would have to use a "Random" keyword along with using a for-loop to do the shuffle. Therefore, I'm not too sure how

python immutable 与mutable

為{幸葍}努か 提交于 2020-03-05 22:59:08
在使用 help topics classes 看到 immutable 与mutable 1、immutable类型有 number string tuple unicode frozenset 2、mutable类型 list dict set immutable类型会重新申请内存,类型ID是不同的 >>> a = 1 >>> id(a) 140383443029032 >>> a = 2 >>> id(a) 140383443029008 >>> type(a) <type 'int'> >>> 来源: oschina 链接: https://my.oschina.net/u/272337/blog/495867

Java继承与多态

天大地大妈咪最大 提交于 2020-03-05 15:35:58
☆ 继承 ☆ 继承是面向对象思想的三大特性之一,使类与类之间产生特殊 - 一般的关系,即is-a关系。 继承是从已有类中派生出新的类,新的类能吸收已有类的属性和方法,并且能拓展新的属性和行为。 在Java中使用extends关键字表示继承,语法表示为: class 子类 extends 父类{}。 子类被称为派生类,父类又被称为超类。 子类继承父类,表明子类是一种特殊的父类,子类拥有父类的属性和方法,并且子类可以拓展具有父类所没有的一些属性和方法。 子类即使不扩展父类,也能维持拥有父类的操作。 优缺点 优点 提高了代码的复用性 提高了代码的维护性 让类与类之间产生了关系,是多态的前提 缺点 增加了耦合性 OOP思想开发原则:高内聚,低耦合 耦合:类与类之间的关系 内聚:自身完成事情的能力 继承特点 Java只支持单继承,不支持多重继承操作(extends A,B,C…) class A { } class B { } class C extends A , B { } // 错误的,一个子类继承了两个父类,Java中不允许 为什么只支持单继承? 多继承会存在安全隐患,因为当继承的多个类都存在相同的属性或方法名相同方法体不同的方法,子类进行调用时,就会产生不知道该调用哪一个类中的方法的情况。 Java支持多层继承(继承体系) class A { } class B extends A