
Java
LSF_Kevin
LSF
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
11. Threads
Thread and Java A thread is a flow of execution of a task (job) from beginning to end One of the powerful features of Java is its support for multi-threading Main Thread When you run a Java pr原创 2016-10-11 06:40:58 · 301 阅读 · 0 评论 -
【Data Structures】 1. Collection
Collections in Java that are called the Java Collections Framework are a set of interfaces and classes that are available for you to use in the java.util. package Java Collections Framework:原创 2016-10-30 23:41:59 · 185 阅读 · 0 评论 -
【Data Structures】 8. Sorting in Java—Comparable and Comparator
To sort an array or a collection of objects, we need to make sure that the objects are mutually comparable. This is supported by the Comparable interface that contains only one method: compareTo(Ob原创 2016-11-16 00:32:29 · 203 阅读 · 0 评论 -
【Data Structures】 3. ArrayList and Binary Search
ArrayList class has many methods: add(object), add(index, object), set(index, object), get(index), remove(index), size() Initial length of new ArrayList is 10. You can also set the initial Array原创 2016-11-01 03:46:56 · 205 阅读 · 0 评论 -
【Data Structures】 9. Recursion: calling itself again
Recursive programming has a method that call itself. However, we do not want to call the method itself recursively to infinity (infinite recursion). The condition that leads to a recursive method re原创 2016-11-16 11:27:23 · 179 阅读 · 0 评论 -
【Data Structures】 2. Arrays and Linear Search
Arrays in Java Arrays in Java can hold primitives and references. Good for storing and accessing a sequence of data. An array in java, in terms of manipulating its data, has one method, clone(), and原创 2016-11-01 02:58:11 · 245 阅读 · 0 评论 -
【Data Structures】 7. Simple Sorting—Bubble Sort, Selection Sort, and Insertion Sort
Bubble sort 1. Compare two values at a time. 2. If the one on the left is bigger, swap them to BUBBLE UP the bigger value to the right. 3. Move one position to the right.原创 2016-11-15 01:41:51 · 257 阅读 · 0 评论 -
【Data Structures】 10. Hashing—Mission Possible
Converting words to numbers, more specifically integers. Workaround 1: Open Addressing (mainly linear probing) Step size: In linearing原创 2016-11-26 23:59:56 · 270 阅读 · 0 评论 -
【Data Structures】 12. Hashing, HashMap and HashSet in Java
The hashCode() method in Java is implemented in the Object class. Basically, the hashCode() method provides a numeric representation of an object. hashCode method in the String class uses the follow原创 2016-11-27 04:04:02 · 237 阅读 · 0 评论 -
【Data Structures】 11. HashTable—Simple Implementation
HashTableInterface interface // HashTable interface that takes only positive integers. // No mapping, just keys public interface HashTableInterface { // Return true when the key is found. boo原创 2016-11-27 01:32:38 · 252 阅读 · 0 评论 -
07. Lists & Maps
Null For reference variables may not be pointing at any object - Not an object - A reserved literal value for reference type Just like "true" or "false" for boolean type - For reference types, de原创 2016-10-06 04:02:08 · 231 阅读 · 0 评论 -
06. Methods & Classes
When you sort an array of ints do the numbers move? Yes. When you sort an array of Objects do the Objects move? No. Why create Methods? Shorter programs - Long methods tend to have too many原创 2016-10-06 00:30:38 · 223 阅读 · 0 评论 -
05. Loops & Arrays
Switch Statements Switch (on char, byte, short, int, String, enum) Most common mistake is leaving out the "break" statement. If you do, control continues into the next case. Default is optional.原创 2016-10-05 16:45:47 · 221 阅读 · 0 评论 -
08. File & Network I/O
Java Interfaces A Java Interface allows you to specify methods that must be implemented by a class - Simply speaking, it is just a list of methods, but no implementations (up to Java 7) - Several i原创 2016-10-13 22:32:36 · 592 阅读 · 0 评论 -
09. Swing Interfaces
How do you get the time in Java? Java Time Original Unix represented time as number of seconds since 1/1/70 00:00 GMT Java represents time in milliseconds since January 1, 1970, 12:00 am GMT Java原创 2016-10-13 23:34:14 · 263 阅读 · 0 评论 -
【Data Structures】 6. Queue—Another limited data structure and FIFO
A queue is a container of objects that are inserted and removed based on FIFO (First-in First-out) principle. In the queue, there are two major operations, enqueue and dequeue. 1. Enqueue means inse原创 2016-11-07 23:37:32 · 282 阅读 · 0 评论 -
【Data Structures】 5. Stack—A limited data structure and LIFO
A stack is a container of objects that are inserted and removed according to the last-in first-out (LIFO) principle. Simply speaking, there are two major operations. 1. Push: push an item onto the t原创 2016-11-07 22:57:47 · 362 阅读 · 0 评论 -
【Data Structures】 4. LinkedList
LinkedList is one of the two general-purpose List implementations. In addition to some general and common methods, LinkedList in Java also offers a few methods that work with the elements at the begin原创 2016-11-02 10:55:40 · 223 阅读 · 0 评论 -
01. Introduction
Why use Java? - Programming Language with the "Right stuff" - Runs "everywhere" Right stuff: - Objected-oriented - Network-oriented - Large Class Libraries - Multithreaded - High-performan原创 2016-10-05 02:19:03 · 222 阅读 · 0 评论 -
02. Primitive Types
JAPL: Just Another Programming Language - Data Types, Literals, Variables, Expressions, Statements, Methods, Arrays, Comments. Primitive Data Types - Written in lower case letters - Declares s原创 2016-10-05 03:12:22 · 368 阅读 · 0 评论 -
03. Java Classes
What is a Class? A class is a templete definition (blueprint) It defines the data contained in objects that are members of a class It defines the methods (operations) that can be performed on those原创 2016-10-05 04:15:30 · 274 阅读 · 0 评论 -
04. Reference Types
N-JAPL: Not Just Another Programming Language - Objects - Portable (Write once, Run anywhere) Create a object in Java: 1. Create a class to define a new type public class Rectangle { int原创 2016-10-05 11:05:14 · 399 阅读 · 0 评论 -
【LeetCode】 415. Add Strings
Given two non-negative numbers num1 and num2 represented as string, return the sum of num1 and num2. Note: The length of both num1 and num2 is Both num1 and num2 contains only digits 0-9.B原创 2016-12-25 12:30:24 · 207 阅读 · 0 评论