mypoint.java
来自「包含了模式识别中常用的一些分类器设计算法」· Java 代码 · 共 85 行
JAVA
85 行
/* * file: MyPoint.java * * last editted: Ryan Irwin */// import necessary java libraries////These imports are not needed - Phil T. 6-23-03//import java.awt.*;//import javax.swing.*;//import java.util.*;/** * implement the equivalent of the AWT class points except this can use * floation point numbers fromt he time domain * */class MyPoint { // ********************************************************************* // // declare global variables and components // // ********************************************************************* // declare class members // public double x = 0.0; public double y = 0.0; // ********************************************************************* // // declare class constructors // // ********************************************************************* /** * constructor initializes the x and y co-odinates to 0.0 * */ MyPoint() { x = 0.0; y = 0.0; } /** * constructor initializes the x and y co-odinates * * @param xval double x co-odinate value * @param yval double y co-odinate value * */ MyPoint(double xval, double yval) { x = xval; y = yval; } /** * constructor initializes the x and y co-odinates * * @param point MyPoint value to be initialized to object */ MyPoint(MyPoint point) { x = point.x; y = point.y; } /** * Converts point to string values * * @return string conversion of x and y co-ordinates * */ public String toString() { return "[" + x + "," + y + "]"; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?