
Java
文章平均质量分 80
vincentgoodturtle
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
[Java]Extend vs Interface
Extends is used when you want attributes of parent class/interface in your child class/interfaceImplements is used when you want attributes of an interface in your class.class Parent{}class Chil...转载 2018-12-18 20:13:47 · 202 阅读 · 0 评论 -
Public/Private, Static, Void/Int/String
public class A{} 表示 class A是公用類 , public擁有最大的訪問權限class A{} 表示class A只能同包(package)使用public int method(){ return } 必須有return 字句因為有返回類型intclass類不會有 public int class 或者 public void class 因為class是一個創造對...原创 2019-07-02 22:10:14 · 375 阅读 · 0 评论 -
Print a list
import java.util.Arrays;int [] abc = {1,2,3,4}System.out.println(Arrays.toString(abc));原创 2019-06-27 21:16:35 · 343 阅读 · 0 评论 -
.getClass 返回class名
package test;public class test2 { public static void main(String[] args) { // TODO Auto-generated method stub test2 abc = new test2(); System.out.println(abc.getClass()); }}原创 2019-07-04 13:48:59 · 293 阅读 · 0 评论 -
Stack和non-recursion中序遍歷
package Stack;import java.util.Stack;public class Try { public static void main(String[] args) { // TODO Auto-generated method stub Stack <Integer >stack = new Stack (); stack.push(9...原创 2019-07-04 14:15:21 · 128 阅读 · 0 评论 -
return null
有時侯一個function已經設定了return type which is Node in this case.如果想要報錯並返回一個非Node的東西時就 return nullpublic Node min_node() { if (root == null) { System.out.println("root not exists"); return null; //...原创 2019-07-04 14:51:54 · 232 阅读 · 0 评论 -
叶子节点
叶子节点没有子节点原创 2019-07-04 16:42:23 · 2521 阅读 · 0 评论 -
BST
import java.util.Stack;public class BinarySearchTree { public Node root; //初始化 Node class // public Node find(int key) { //創建method "find" with data type being Node// // } //中序遍歷 public ...原创 2019-07-04 20:13:54 · 299 阅读 · 0 评论 -
225
class MyStack {/** Initialize your data structure here. */public MyStack() { Queue <> q = new Linkedlist <>;}/** Push element x onto stack. */public void push(int x) { q.poll...原创 2019-07-10 15:11:48 · 244 阅读 · 0 评论 -
[Java]Abstract Class
A class that is declared using the abstract keyword is known as abstract class. Abstraction is a process of hiding the data implementation details, and showing only functionality to the user. Abstract...转载 2018-12-18 20:25:36 · 451 阅读 · 0 评论 -
算法的學習
背代碼沒有用多刷LeetCode一些復雜的算法如紅黑樹, KMP不用知道如何去實現, 需原创 2019-07-07 12:21:37 · 148 阅读 · 0 评论