第3章 面向对象基础知识
来源:互联网 发布:3d打印机切片算法 编辑:程序博客网 时间:2024/06/03 17:42
String类的常用方法
public String(char[] value)public String(char[] value, int offset, int count)public char charAt(int index)public char[] toCharArray()public String(byte[] bytes)public String(byte[] bytes, int offset, int length)public byte[] getBytes()public byte[] getBytes(String charsetName)throws UnsupportedEncodingEceptionpublic boolean equals(String anObject)public boolean equalsIgnoreCase(String anotherString)public int compareTo(String anotherString)public boolean contains(String s)public int indexOf(String str)public int indexOf(String str, int fromIndex)public int lastIndexOf(String str)public int lastIndexOf(String str, int fromIndex)public boolean startsWith(String prefix)public boolean startsWith(String prefix, intoffset)public boolean endsWith(String suffix)public String replaceAll(String regex, String replacement)public String replaceFirst(String regex, String replacement)public String substring(int beginIndex) public String substring(int beginIndex, int endIndex)public String[] split(String regex)public String[] split(String regex, int limit)public String concat(Stirng str)public String toLowerCase()public String toUpperCase()public String trim()public int length()public String intern()public boolean isEmpty()
数据表一对多关系转为类间关系
一个部门Dept有多个雇员Emps
要根据部门取出雇员信息
class Dept { private Emp[] emps ; public void setEmp() { this.emps = emps; } public Emp[] getEmps() { return this.emps; }}class Emp {} public class Test { System.out.println(dept.getInfo()); for(int x=0; x < dept.getEmps().length; x++) { System.out.println(dept.getEmps()[x].getInfo()); }}
阅读全文
0 0
- 第3章 面向对象基础知识
- 《Objective-C基础教程》第3章 面向对象编程的基础知识
- 第二章 -- 面向对象基础知识
- 第3章面向对象程序设计
- 第3章 面向对象设计基础
- 第3章面向对象(上)
- 第3章 面向对象基础
- 第三章 面向对象编程基础知识
- 第2章 面向对象
- 第10章 面向对象
- Java基础知识<3>-面向对象程序设计
- 面向对象基础知识(3)- 方法重载
- Java基础知识之面向对象(3)
- c++面向对象基础知识 Day 3
- 基础知识----面向对象思想
- 面向对象----类基础知识
- c#面向对象基础知识
- 面向对象的基础知识
- 小朋友学C语言(19):字符和整数的关系
- Java线程池 ExecutorService
- HTML简介
- 小朋友学C语言(20):数组
- 程序排优
- 第3章 面向对象基础知识
- Caused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration.
- 汇编语言(2)
- (复学梳理) 快速幂求模[代码思想详解]
- Windows系统下利用caffe训练NYU Depth数据集(一)
- SOAP简单对象访问协议
- 【BZOJ1911】【APIO2010】特别行动队
- Leetcode SQL题
- Linux chmod 命令