`
vivambulate
  • 浏览: 9580 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Chapter 3 Fundamental Programming Structures in Java[CJ 8e NOTE]

 
阅读更多

这一章介绍Java的基础结构,如8种基本数据类型、数组、控制等。

我记一下平时用的比较少的。

 

StringBuilder, a class that can be used to build a long string from many pieces, which is more efficient than concatentation. StringBuilder should used in a single thread.Instead, StringBuffer allows mutiple threads to operate.

 

java.util.Scanner in = new Scanner(System.in);

 

java.io.Console cons = System.console();

String username = cons.readline("User name: ");

char[] passwd = cons.readPassword("Password: "); //Security issue

 

Formatting Output

    System.out.printf(), similar with printf() method from C

 

Array Copying

    int[] arrayA = arrayB; //both variables refer to the same array

    int[] arrayA = Arrays.copyOf(arrayB, arrayB.length); //copy all values of arrayB to a new array arrayA

    System.arraycopy(fromArray, fromIndex, toArray, toIndex, count); //the toArray must have suffient space to hold the copied elements

 

Array Sorting

    Arrays.sort(array); //this method used a tuned version of QS

分享到:
评论

相关推荐

    java基础部分英文ppt.rar

    Chapter 1 An Introduction to Java Chapter 2 The Java ...Chapter 3 Fundamental Programming Structures in Java Chapter 4 Objects and Classes Chapter 5 Inheritance Chapter 6 Interfaces and Inner Classes

    Data Structures and Algorithms in Java, 5th Edition (Part 3/3)

    Goodrich and Tamassia’s Fourth Edition of Data Structures and Algorithms in Java continues to offer accessible coverage of fundamental data structures, using a consistent object–oriented framework....

    Data Structures and Algorithms in Java, 5th Edition (Part 2/3)

    Goodrich and Tamassia’s Fourth Edition of Data Structures and Algorithms in Java continues to offer accessible coverage of fundamental data structures, using a consistent object–oriented framework....

    Core Java 9th Edition(Vol1,Vol2)

    Fundamental Programming Structures in Java Chapter 4. Objects and Classes Chapter 5. Inheritance Chapter 6. Interfaces and Inner Classes Chapter 7. Graphics Programming Chapter 8. Event Handling ...

    JAVA核心技术卷一卷二(中文)之part2分卷

    Chapter 3 Fundamental Programming Structures in Java(新增批注共44条) Chapter 4 Objects and Classes(新增批注共55条) Chapter 5 Inheritance(新增批注共42条) Chapter 6 Interfaces and Inner Classes...

    JAVA核心技术卷一卷二(中文)之part4分卷

    Chapter 3 Fundamental Programming Structures in Java(新增批注共44条) Chapter 4 Objects and Classes(新增批注共55条) Chapter 5 Inheritance(新增批注共42条) Chapter 6 Interfaces and Inner Classes...

    JAVA核心技术卷一卷二(中文)之part3分卷

    Chapter 3 Fundamental Programming Structures in Java(新增批注共44条) Chapter 4 Objects and Classes(新增批注共55条) Chapter 5 Inheritance(新增批注共42条) Chapter 6 Interfaces and Inner Classes...

    Data Structures and Algorithms in Java, 5th Edition (Part 1/3)

    Goodrich and Tamassia’s Fourth Edition of Data Structures and Algorithms in Java continues to offer accessible coverage of fundamental data structures, using a consistent object–oriented framework....

    JAVA核心技术卷一卷二(中文)之part1分卷

    Chapter 3 Fundamental Programming Structures in Java(新增批注共44条) Chapter 4 Objects and Classes(新增批注共55条) Chapter 5 Inheritance(新增批注共42条) Chapter 6 Interfaces and Inner Classes...

    Data structures and Algorithms in Java

    标题《Data structures and Algorithms in Java》及描述《数据结构和算法 Adam Drozdek Fundamental data structures in a consistent object-oriented framework》表明,本文档是一本关于Java中数据结构和算法的...

    Fundamental Networking in Java

    - ISBN-10: 1-84628-030-3 - ISBN-13: 978-1846-2803-6 - 打印在无酸纸上 - **排版信息**: - 使用Adobe FrameMaker、Acrobat和Distiller进行排版 - 在Macintosh和PC平台上完成 - 文本采用10/11点FF Scala和...

    Data Structures, Algorithms and Applications in C++ Second Edition

    Data Structures, Algorithms and Applications in C++ Second Edition Sartraj Sahni | Universities Press 2005 | ISBN: 817371522X | PDF | 826 Pages | 27 MB Description The study of data structures and ...

    Core Java. Volume I. Fundamentals, 8th Edition JAVA核心技术1基础知识

    3 FUNDAMENTAL PROGRAMMING STRUCTURES IN JAVA 4 OBJECTS AND CLASSES 5 INHERITANCE 6 INTERFACES AND INNER CLASSES 7 GRAPHICS PROGRAMMING 8 EVENT HANDLING 9 USER INTERFACE COMPONENTS WITH SWING 10 ...

    Fundamental 2D Game Programming with Java_javaprogramming_2D_jav

    《Fundamental 2D Game Programming with Java》是一本专注于教授如何使用Java编程语言进行2D游戏开发的书籍。这本书旨在帮助初学者理解2D游戏的基本原理,并通过实践掌握Java编程技术。以下是一些核心知识点的详细...

    java第二次试验

    In conclusion, this Java laboratory report covers fundamental programming structures in Java, including data types, variables, assignments, and operators. The three experiments demonstrate the ...

    Programming.Problems.in.Java.A.Primer.for.the.Technical.Interview.epub

    If you are learning to code then this book provides a great introduction to Java and fundamental data structures and algorithms. If you are preparing for an interview or want to challenge yourself, ...

    Thinking in C: Foundations for Java & C++

    Thinking in C: Foundations for Java & C++ by Chuck Allison produced by Bruce Eckel Chapter 1: Introduction and Getting Started40 MinutesStart Lecture Chapter 2: Fundamental Data Types41 ...

    Fundamental 2D Game Programming with Java 无水印pdf

    Fundamental 2D Game Programming with Java 英文无水印pdf pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权...

Global site tag (gtag.js) - Google Analytics