原创 Java中接口與抽象類的區別

一、抽象類 在Java中,被關鍵字abstract修飾的類稱爲抽象類;被abstract修飾的方法稱爲抽象方法,抽象方法只有方法聲明沒有方法體。抽象類有以下幾個特點:1、抽象類不能被實例化,只能被繼承。2、包含抽象方法的類一定是抽象類,但抽

原创 Valid Parentheses之Java實現

一、題目 Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is val

原创 Longest Common Prefix之Java實現

一、題目 Write a function to find the longest common prefix string amongst an array of strings.If there is no common prefix,

原创 Palindrome Number之Java實現

一、題目 Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward

原创 Reverse Integer之Java實現

一、題目 Given a 32-bit signed integer, reverse digits of an integer.Example 1: Input: 123 Output: 321Example 2:  Input: -12

原创 什麼是面向過程?什麼是面向對象?面向對象的三大基本特徵是什麼?

一、什麼是面向過程? 面向過程是一種以過程爲中心的編程思想,其原理就是將問題分解成一個一個詳細的步驟,然後通過函數實現每一個步驟,並依次調用。面向過程我們所關心的是解決一個問題的步驟,舉個例子,汽車發動、汽車熄火,這是兩個不同的事件,對於面

原创 TwoSum之Java實現

一、題目 Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may as