代码搜索:Getting
找到约 2,749 项符合「Getting」的源代码
代码结果 2,749
www.eeworm.com/read/127767/14335861
txt e243. getting the driver of a connection.txt
Given a connection, it is not possible to determine the driver that created the connection. Although the connection can return a driver name, the returned name cannot be used to find the driver. For e
www.eeworm.com/read/127767/14335865
txt e021. getting the size of a file.txt
File file = new File("infilename");
// Get the number of bytes in the file
long length = file.length();
www.eeworm.com/read/127767/14335906
txt e366. getting and setting properties.txt
String string = properties.getProperty("a.b");
properties.setProperty("a.b", "new value");
www.eeworm.com/read/127767/14335985
txt e059. getting a class object.txt
There are three ways to retrieve a Class object.
// By way of an object
Class cls = object.getClass();
// By way of a string
try {
cls = Class.forName("java.lang.St
www.eeworm.com/read/127767/14336081
txt e369. getting the current time.txt
Calendar cal = new GregorianCalendar();
// Get the components of the time
int hour12 = cal.get(Calendar.HOUR); // 0..11
int hour24 = cal.get(Calendar.HOUR_OF_DAY);
www.eeworm.com/read/127767/14336103
txt e055. getting the size of the heap.txt
The heap is the area in memory in which objects are created.
// Get current size of heap in bytes
long heapSize = Runtime.getRuntime().totalMemory();
// Get maximum size of heap
www.eeworm.com/read/127767/14336305
txt e600. getting the number of screens.txt
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
try {
GraphicsDevice[] gs = ge.getScreenDevices();
// Get number of screens
int numScr
www.eeworm.com/read/127767/14336428
txt e066. getting the package of a class.txt
Class cls = java.lang.String.class;
Package pkg = cls.getPackage();
String name = pkg.getName(); // java.lang
// getPackage() returns null for a class in the unnamed
www.eeworm.com/read/127767/14336506
txt e373. getting the current date.txt
Calendar cal = new GregorianCalendar();
// Get the components of the date
int era = cal.get(Calendar.ERA); // 0=BC, 1=AD
int year = cal.get(Calendar.YEAR);
www.eeworm.com/read/127767/14336528
txt e593. getting the dimensions of text.txt
// From within the paint() method
public void paint(Graphics g) {
Graphics2D g2d = (Graphics2D)g;
Font font = new Font("Serif", Font.PLAIN, 12);
FontMetrics fontMetrics