网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
String data="It is Sunday.";String str1;str1=data.substring(1,5);则str1为()
- A、Iti
- B、tis
- C、tisi
- D、Itis
参考答案
更多 “String data="It is Sunday.";String str1;str1=data.substring(1,5);则str1为()A、ItiB、tisC、tisiD、Itis” 相关考题
考题
下面程序的目的是在屏幕上显示当前目录下的文件信息。文件信息通过表格JTable的实例显示。请改正程序中的错误(有下划线的语句),使程序能输出正确的结果。注意:不改动程序的结构,不得增行或删行。import java.awt.*;import javax.swing.*;import java.util. Date;import javax.swing.table.*;import java.applet.*;import java.io.*;public class Example3_10 extends JApplet, JFrame{public void init(){FileModel fm = new FileModel();JTable jt = new JTable();jt.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);jt.setColumnSelectionAllowed(true);JScrollPane jsp = new JScrollPane(jt);getContentPane().add(jsp, BorderLayout.CENTER);}public static void main(String args[]){Example3_10 ft = new Example3_10();ft.init();JFrame. f = new JFrame();f.setDefaultCloseOperation(JFrame.EXIT ON CLOSE);f.getContentPane() .add(ft.getContentPane());f.setSize (300, 400);f.show();}}class FileModel extends AbstractTableModel{String[] columnName = new String[] {"文件名", "大小", "最后修改时间"}Object[] [] data;public FileModel() { this("."); }public FileModel(String dir){File file = new File(dir);String files[] = file.list();data = new Object [files.length] [columnName.length];for (int i=0; i < files.length; i++){File tmp = new File (files[i]);data[i] [0] = tmp.getName();data[i] [1] = new Long(tmp.length());data[i] [2] = new Date(tmp.lastModified() );}}public int getColumnNumber(){return columnName.length;}public int getRowCount(){return data. length;}public String getColumnName(int col){return columnName[col];}public Object getValueAt(int row, int col){return data[row] [col];}public Class getColumnClass(int c){return getValueAt (0, c) .getClass();}}
考题
阅读以下说明和C++程序,将应填入(n)处的字句写在对应栏内。【说明】字符串在程序设计中扮演着重要角色。现需要设计字符串基类string,包含设置字 符串、返回字符串长度及内容等功能。另有一个具有编辑功能的串类edlt_string,派生于string,在其中设置一个光标,使其能支持在光标处的插入、删除操作。【程序】include <iostream.h>include <stdio.h>include <string.h>class string{int length;char *data;public:int get_length() {return length;}char *get_data() {return data;}~string() {delete data;}int set data(int in_length, char *in_data);int set_data(char *data);void print() {cout<<data<<endl;}};class edit_string: public string{int cursor;public:int get_cursor() {return cursor;}void move_cursor(int dis) {cursor=dis;}int add_data(string *new_data);void delete_data(int num);};int string::set_data(int in_length,char *in_data){length=in_length;if(!data)delete data;(1)strcpy(data,in_data);return length;}int string::set data(char *in_data){(2)if(!data)delete data;(1)strcpy(data,in_data);return length;}int edit_string::add_data(string *new_data){int n,k,m;char *cp,*pt;n=new_data->get_length();pt=new_data->get_data();cp=this->get_data();m=this->get_length();char *news=new char[n+m+1];for(int i=0; i<cursor; i++)news[i]=cp[i];k=i;for(int j=0; j<n; i++,j++)news[i]=pt[j];cursor=i;for(j=k; j<m; j++,i++)(3)news[i]='\0';(4)delete news;return cursor;}void edit string::delete_data( int num){int m;char *cp;cp=this->get_data();m=this->get_length();for(int i=cursor; i<m; i++)(5)cp[i]='\0';}
考题
下列程序的运行结果是public class test{private String[] data={“10”,“10.5”};public void fun(){double s=0;for(int i=0;i3;i++){try{s=s+Integer .parseInt(data[i]);}catch(Exception e){System.out.print(“errorl:”+data[i]);}}}public static void main(String[]args){try{testd=new test();d .fun();}catch(Exception e){System.out.printIn(“error2”);}}}A.errorl:10.5B.error2C.errorl:10.5 error2D.以上都不对
考题
请完成程序,首先由一个类simple实现Serializable接口,并有三个成员变量,分别为int型、double型和String型,可以用toString的方法显示这三个成员变量。在main方法中创建这个simple的持久对象,根据用户在命令行输入的三个参数来设定其中成员变量的值。然后,将这个对象写入名为TheSerial.data的文件中,并显示成员变量。最后从文件TheSerial.data中读出三个成员变量并显示出来。注意:请勿修改main()主方法和其他已有语句内容,仅在横线处填入适当语句。import java.io.*;class TheSerial implements Serializable{private int intvalue;private double doublevalue;private String string;The Serial (){intvalue=123;doublevalue=12.34;string="Serialize Test";}public void setDouble(double d){doublevalue=d;}public void setInt(int i){intvalue=i;}public void setString(String s){string=s;}public String to String(){return("int="+intvalue+" double="+doublevalue+" string="+string);}}public class simple{public static void main(String[] args){The Serial e1=new TheSerial();TheSerial e2;try{e1.setInt(Integer.parseInt(args[0]));e1.setDouble(Double.parseDouble(args[1]));e1.setString(args[2]);}catch(Exception e){e1.setString(e.getMessage());}System.out.println(e1);try{FileOutputStream S=new FileOutputStream("TheSerial.data");ObjectOutputStream OS=new ObjectOutputStream(oS);______;}catch(IOException ioException){System.out.println (ioException.getMessage ());}try{FileInputStream iS=new FileInputStream("TheSerial.data");ObjectInputStream IS=new ObjectInputStream(iS);______;System.out.println(e2);}catch(IOException ioException){System.out.println(ioException.getMessage());}catch(ClassNotFoundException cnfException){System.out.println(cnfException.getMessage());}}}
考题
You are consuming a Windows Communication Foundation (WCF) service in an ASP. NET Web application.The service interface is defined as follows:[ServiceContract]public interface ICatalog{ [OperationContract] [WebGet(UriTemplate="/Catalog/Items/{id}", ResponseFormat=WebMessageFormat.Json)] string RetrieveItemDescription(int id); } The service is hosted at Catalogsvc.You need to call the service using jQuery to retrieve the description of an item as indicated by a variable named itemId. Which code segment should you use?()A. $get(String.format(/Catalogsvc/Catalog/Items/id{0}, itemId) null, function (data) { ... }, javascript);B. $get(String.format(/Catalogsvc/Catalog/Items/{0}, itemId), null, function (data) { ... }, json);C. $get(String.format(/Catalogsvc/Catalog/Items/{0}, itemld), null, function (data) { ... }, xml);D. $get(String.format(/Catalogsvc/Catalog/Items/id{0}, itemld), null, function (data) { ... }, json);
考题
Which statement describes the ROWID data type? ()
A. Binary data up to 4 gigabytes.B. Character data up to 4 gigabytes.C. Raw binary data of variable length up to 2 gigabytes.D. Binary data stored in an external file, up to 4 gigabytes.E. A hexadecimal string representing the unique address of a row in its table.
考题
阅读下列程序说明和C++程序,把应填入其中(n)处的字句,写对应栏内。【说明】下面的程序实现了类String的构造函数、析构函数和赋值函数。已知类String的原型为:class String{public:String(coust char * str = NULL); //普通构造函数String( const String other); //拷贝构造函数~String(void); //析构函数String perate =(const String other); //赋值函数private:char * m_data; // 用于保存字符串};//String 的析构函数String:: ~String (void){(1);}//String 的普通构造函数String: :String( const char * str){if (2){m_data = new char[1];*m_data = '\0';}else{int length = strlen(str);m_data = new ehar[ length + 1 ];strepy(m_data, str);}}//拷贝的构造函数String:: String( const String other){ int length = strlen(other. m_data);m_data = new char[ length + 1 ];strepy(m_data, other, m_data); //赋值函数String String::operate = (eonst String other) //{if (3)return * this;delete [] m_clara; //释放原有的内存资源int length = strlen( other, m_data);m_data = new chart length + 1 ];(4);return (5);}
考题
请完成以下程序,首先由一个类Example2_3实现Serializable接口,并有三个成员变量,分别为int型、double型和String型,可以用toString的方法显示这三个成员变量。在main方法中创建这个Example2_3的持久对象,根据用户在命令行输入的三个参数来设定其中成员变量的值。然后,将这个对象写入名为TheSerial.data的文件,并显示成员变量。最后从文件TheSerial.data中读出三个成员变量并显示出来。注意:请勿改动main()主方法和其他已有语句内容,仅在横线处填入适当语句。import java.io.*;class TheSerial implements Serializable{private int intValue;private double doubleValue;private String string;TheSerial(){intValue = 123;doubleValue = 12.34;string = "Serialize Test";}public void setDouble(double d){doubleValue = d;}public void setInt(int i){intValue = i;}public void setString(String s){string = s;}public String toString(){return("int="+intValue+"double="+doubleValue+" string="+string);}}public class Example2_3{public static void main(String argv[]){TheSerial e1 = new TheSerial();TheSerial e2;try{e1.setInt(Integer.parseInt(argv[0]));e1.setDouble(Double.parseDouble(argv[1]));e1.setString[argv[2]);}catch(Exception e){e1.setString(e.getMessage{));}System.out.println(e1);try{FileOutputStream S = new FileOutputStream("TheSerial.data");ObjectOutputStream IS = new ObjectOutputStream(oS);______;}catch(IOException ioException){System.out.println(ioException.getMessage());}try{FileInputStream iS = new FileInputStream("TheSerial. data");ObjectInputStream IS = new ObjectInputStream(iS);______System.out.println(e2);}catch(IOException ioException){System.out.println(ioException.getMessage());}catch(ClassNotFoundException cnfException){System.out.println(cnfException.getMessage());}}}
考题
已知String类定义如下:class String{public:String(const char *str = NULL); // 通用构造函数String(const String another); // 拷贝构造函数~ String(); // 析构函数String perater =(const String rhs); // 赋值函数private:char *m_data; // 用于保存字符串};尝试写出类的成员函数实现。
考题
已知类 String 的原型为class string{public:string(const char *str=null);//普通构造函数string(const string other);//拷贝构造函数---string(void);string operate=(const string other);//赋值函数private:char * m-data;//用于保存字符串};请编写 string 的上述4 个函数
考题
编写类 String 的构造函数、析构函数和赋值函数已知类 String的原型为:class String{public:String(const char *str = NULL); // 普通构造函数String(const String other); // 拷贝构造函数~ String(void); // 析构函数String perate =(const String other); // 赋值函数private:char *m_data; // 用于保存字符串};请编写 String的上述 4 个函数。
考题
{ public static void main(String args[]) { System.out.println(MyClass1.data); } } class MyClass1 { int data=10; } 。()
此题为判断题(对,错)。
考题
在个人geodatabase中,下列哪种字段类型是有效的?()A、boolean、string、blob、singleB、string、text、guid、longrawC、data、blob、raster、floatD、double、boolean、binary、number
考题
String date="Today is Sunday.";String str2=data.CharAt(s.length( )-1);则str2为()A、yB、.C、nullD、false
考题
类MyClass的定义如下: Public Class MyClass Private data as String End Class 则关键字Private在类的定义中的作用是()A、限定成员变量data 只在本模块内部可以使用B、限定成员变量data 仅在类MyClass中可以访问C、限定成员变量data 仅在类MyClass及其子类中可以访问D、限定类MyClass 仅在本模块中可以使用
考题
Which three tasks can be performed using regular expression support in Oracle Database 10g?()A、 it can be used to concatenate two strings.B、 it can be used to find out the total length of the string.C、 it can be used for string manipulation and searching operations.D、 it can be used to format the output for a column or expression having string data.E、 it can be used to find and replace operations for a column or expression having string data.
考题
You are consuming a Windows Communication Foundation (WCF) service in an ASP. NET Web application.The service interface is defined as follows:[ServiceContract]public interface ICatalog{ [OperationContract] [WebGet(UriTemplate="/Catalog/Items/{id}", ResponseFormat=WebMessageFormat.Json)] string RetrieveItemDescription(int id); } The service is hosted at Catalogsvc.You need to call the service using jQuery to retrieve the description of an item as indicated by a variable named itemId. Which code segment should you use?()A、$get(String.format("/Catalogsvc/Catalog/Items/id{0}", itemId) null, function (data) { ... }, javascript");B、$get(String.format("/Catalogsvc/Catalog/Items/{0}", itemId), null, function (data) { ... }, "json");C、$get(String.format("/Catalogsvc/Catalog/Items/{0}", itemld), null, function (data) { ... }, "xml");D、$get(String.format("/Catalogsvc/Catalog/Items/id{0}", itemld), null, function (data) { ... }, "json");
考题
You are developing an ASP.NET Web application. The application must pass an object that contains user-specific data between multiple pages. The object ismore than 100 KB in size when serialized.You need to minimize the amount of data is sent to the user. What should you do?()A、Pass the object data in a hidden field.B、Store the object instance in a session variable.C、Use a cookie that contains the object data.D、Encode the object data and pass it in a query string parameter.
考题
单选题Your database is in NOARCHIVELOG mode and a logswitch happens every 20 minutes. On Thursday morning,media failure resulted in corruption of a data file belonging to the TOOLS tablespace. Backups are taken on every Sunday. What would you do in this situation?()A
recover using Oracle Flashback Database technologyB
restore the data files from backup and perform a complete recoveryC
restore only the corrupted data file and perform tablespace recoveryD
restore the data files from backup and perform cancel-based recoveryE
restore the entire database from the most recent backup and start the instance and open the database
考题
多选题Which three tasks can be performed using regular expression support in Oracle Database 10g?()Ait can be used to concatenate two strings.Bit can be used to find out the total length of the string.Cit can be used for string manipulation and searching operations.Dit can be used to format the output for a column or expression having string data.Eit can be used to find and replace operations for a column or expression having string data.
考题
单选题类MyClass的定义如下: Public Class MyClass Private data as String End Class 则关键字Private在类的定义中的作用是()A
限定成员变量data 只在本模块内部可以使用B
限定成员变量data 仅在类MyClass中可以访问C
限定成员变量data 仅在类MyClass及其子类中可以访问D
限定类MyClass 仅在本模块中可以使用
考题
单选题String date="Today is Sunday.";String str2=data.CharAt(s.length( )-1);则str2为()A
yB
.C
nullD
false
考题
单选题Which statement describes the ROWID data type?()A
Binary data up to 4 gigabytes.B
Character data up to 4 gigabytes.C
Raw binary data of variable length up to 2 gigabytes.D
Binary data stored in an external file, up to 4 gigabytes.E
A hexadecimal string representing the unique address of a row in its table.
考题
单选题下列程序的运行结果是( )。public class test{private String [] data = {"10","10.5"};public void fun(){ double s = 0; for(int i = 0; i try{ s = s + Integer.parseInt(data[i]); } catch(Exception e){ System.out.print("error1:" + data[i]); } }}public static void main(String[] args){ try{ test d = new test(); d.fun(); } catch(Exception e){ System.out.println("error2"); }} }A
error1:10.5B
error2C
error1:10.5error2D
以上都不对
考题
单选题You design a Business Intelligence (BI) solution by using SQL Server 2008. You create a SQL Server 2008 Reporting Services (SSRS) solution by using SQL Server 2008. Several reports on the server use a shared data source named DSProduction. You modify an existing report that uses the DSProduction data source. After deployment, the modified report must use an alternate data source. You need to prevent the modified report from affecting other reports. What should you do?()A
Update the connection string of the DSProduction shared data source to point to the alternate data source.B
Update the modified report to use a report-specific data source. Update the connection string of the report-specific data source to point to the alternate data source.C
Create a new shared data source named DSProduction in the same folder as that of the modified report. Update the connection string of the new shared data source to point to the alternate data source.D
Disable the DSProduction data source. Update the modified report to use a report-specific data source. Update the connection string of the report-specific data source to point to the alternate data source.
热门标签
最新试卷