📄 testobject.java
字号:
package com.newegg.test;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class TestObject
{
private String name;
private int price;
public TestObject ( String name , int price )
{
// System.out.println(TYPE_NAMES.getClass().getName());
// for (int i = 0; i < TYPE_NAMES.size(); i++)
// {
// String array_element = (String)TYPE_NAMES.get(i);
// System.out.println(array_element);
//
// }
this.name = name;
this.price = price;
}
// JavaBean properties
// Note that public fields are not visible directly;
// you must write a getter method for them.
public String getName()
{
return name;
}
/**
* @param name
* the name to set
*/
public void setName(String name)
{
this.name = name;
}
/**
* @param price
* the price to set
*/
public void setPrice(int price)
{
this.price = price;
}
public int getPrice()
{
return price;
}
// A method
public double sin(double x)
{
return Math.sin(x);
}
public static final List TYPE_NAMES = Collections.unmodifiableList(Arrays.asList(new String[]
{ "UNKNOWN", "TIME", "DATE", "DATETIME" }));
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -