执行以下代码会输出什么结果?() public class Test { StringgetStr(String s){ return s + “hello”; } public static void main(String arg[]) { Test t= new Test(); System.out.println(t.getStr(“LiLei\n”)); } }
public class X { public static void main (String[]args) { string s = new string (“Hello”); modify(s); System.out.printIn(s); } public static void modify (String s) { s += “world!”; } } What is the result?()
public class X { public static void main (Stringargs) { string s = new string (“Hello”); modify(s); System.out.printIn(s); } public static void modify (String s) { s += “world!”; } } What is the result?()
String s=”hello”; String t=”hello”; char c[]=\{‘h’,’e’,’l’,’l’,’o’\}; 下列( )表达式返回true.
如下这段代码执行后,字符串s的值是________?String s=”hello”;s.concat(“mrs”);s.toUpperCase();s+=” there”;
先阅读下面的程序片段:String str1=new String(\java\);String str2=new String(\java\);StringBuffer str3=new StringBuffer(\java\);对于上述定义的变量,以下表达式的值为true的是哪个?( )
执行下面的代码会引发()异常。 String str = null; String strTest = new String(str);
C中,string str = null 与 string str =””,请尽量用文字说明区别。(要点:说明详细的内存
C中,string str = null 与 string str =””,请尽量用文字说明区别。(要点:说明详细的内存空间
分析下面的程序,指出程序中的错误:# include <stdio.h>int main( void){ char a; char *str=&a; strcpy(str,"hello"); printf("%s",str); return 0;}
以下程序的输出结果是()。 char str[15]=”hello!”; printf(“%d\n”,strlen(str));
执行下面语句后,输出结果是()String s=""hello,World!"";System.out.println(s.length()); A、12B、14C、16D、18
有以下程序: include<stdio.h> include<string.h> main() {char str[][20][{"One*World","One*Dream!"},*p=str[1]; prinft("%d,",strlen(p));printf("%s\n",p); } 程序运行后的输出结果是()。
下列的哪个程序段可能导致错误?()A.String s="hello"; String t="good"; String k=s+t;B.String
Python代码"strl=‘Hello';print(str1.swapcase())"执行的结果为HELLO'()
使用语句char str[10]=“hello”;对字符数组初始化,则str[1]和str[5]的值分别是多少?()
PHP程序使用utf-8编码,以下程序输出结果是( )。 <?php $str = 'hello你好世界'; echo strlen($str); ?>
StringBuffer str=new StringBuffer(25);String s=”Hello”,若执行语句str.append(s)后,str.length()和str.capacity()的返回值为()。
将字符串数据:"Thisisateststring."作为string类型对象str的初始值,可以使用C++语句序列:chars[]="Thisisateststring.";stringstr(s);()此题为判断题(对,错)。
quiz0606 对于以下的程序 String str=new String(); str的内容"我的一切"存储在哪个地方?
下面程序段的输出结果是()。 include<string.h> void main() char str1[10]="s","t","u","d","e","n","t"; printf("%d",strlen (str1));
下面程序的输出结果为()。 include<string.h> void main() char p1[7]="abc",p2 ="ABC",str[50]="xyz"; strcpy(str,strcat(p1,p2)); printf("%s",str);
已有文本文件test.txt,其中的内容为:Hello, everyone!(,与everyone之间没有空格)。以下程序中,文件test.txt已正确为“读”而打开,由此文件指针fr指向文件,则程序的输出结果是______。 include <stdio.h> void main() FILE *fr; char str[40]; …… fgets(str,8,fr); printf("%s",
以下程序运行后输出的结果是______。 include <string.h> char*ss(char *s) char *p,t; p=s+1;t=*s; while(*p)*p=*(p-1);p++; *(p-1)=t; return s: main() char *p,str[10]="abcdefgh"; p=ss(str); printf("%s",p);