Given: 12.Date date = new Date(); 13.df.setLocale(Locale.ITALY); 14.String s = df.format(date); The variable df is an object of type DateFormat that has been initialized in line 11. What is the result if this code is run on December 14, 2000?()
A . The value of s is 14-dic-2000.
B . The value of s is Dec 14, 2000.
C . An exception is thrown at runtime.
D . Compilation fails because of an error in line 13.
相似题目
-
Given a vaid DateFormat object named df, and
https://assets.asklib.com/images/image2/2018080115304982424.jpg
What updates d’s value with the date represented by ds?()
A . 18.d=df.parse(ds);
B . 18.d=df.getDate(ds);
C . 18.try{19.d=df.parse(ds);20. }catch(ParseException e){ }
D . 18.try{19.d=df.getDate(ds);20. }catch(ParseException e){ }
-
Which statements are true, given the code new FileOutputStream("data", true) for creating an object of class FileOutputStream?()
A . FileOutputStream has no constructors matching the given arguments.
B . An IOExeception will be thrown if a file named "data" already exists.
C . An IOExeception will be thrown if a file named "data" does not already exist.
D . If a file named "data" exists, its contents will be reset and overwritten.
E . If a file named "data" exists, output will be appended to its current contents.
-
Given:
https://assets.asklib.com/images/image2/2018080115292822362.png
What creates the appropriate DateFormat object and adds a day to the Date object?()
A . 35. DateFormat df = DateFormat.getDateFormat();42. d.setTime( (60 * 60 * 24) + d.getTime());
B . 35. DateFormat df = DateFormat.getDateInstance();42. d.setTime( (1000 * 60 * 60 * 24) + d.getTime());
C . 35. DateFormat df = DateFormat.getDateFormat();42. d.setLocalTime( (1000*60*60*24) + d.getLocalTime());
D . 35. DateFormat df = DateFormat.getDateInstance();42. d.setLocalTime( (60 * 60 * 24) + d.getLocalTime());
-
Given: class ClassA {} class ClassB extends ClassA {} class ClassC extends ClassA {} and: ClassA p0 = new ClassA(); ClassB p1 = new ClassB(); ClassC p2 = new ClassC(); ClassA p3 = new ClassB(); ClassA p4 = new ClassC(); Which three are valid?()
A . p0 = p1;
B . p1 = p2;
C . p2 = p4;
D . p2 = (ClassC)p1;
E . p1 = (ClassB)p3;
F . p2 = (ClassC)p4;
-
Given: 8.int index = 1: 9.Boolean [] test = new boolcan [3]; 10.boolcan foo = test [index]; What is the result()?
A . foo has the value of 0.
B . foo has the value of null.
C . foo has the value of true.
D . foo has the value of false.
E . An-exception is thrown.
F . The code will not compile.
-
Given: Integer i = new Integer (42); Long l = new Long (42); Double d = new Double (42.0); Which two expression evaluate to true?()
A . (i = = l)
B . (i = = d)
C . (d = = l)
D . (i.equals(d))
E . (i.equals(i))
F . (i.equals(42))
-
当键入日期时,显示信息:Invalid date Enter new date(mm-dd-yy)的含义是()。
A . 无效的日期
B . 请输入新的日期
C . 无效的命令
D . 无效的日期,请输入新的日期
-
14. DateFormat df; 15. Date date = new Date(); 16. //insert code here 17. String s = df.format( date); Which two,inserted independently at line 16, allow the code to compile?()
A . df= new DateFormat();
B . df= Date.getFormatter();
C . df= date.getFormatter();
D . df= date.getDateFormatter();
E . df = DateFormat.getDateInstance();
F . df= DateFormat.getInstance();
-
16. Date d = new Date(0L); 17. String ds = “December 15, 2004”; 18. // insert code here What updates d‟s value with the date represented by ds?()
A . 18. d = df.parse(ds);
B . 18. d = df.getDate(ds);
C . 18. try { 19. d = df.parse(ds); 20. } catch(ParseException e) { };
D . 18. try { 19. d = df.getDate(ds); 20. } catch(ParseException e) { };
-
Given that Thing is a class, how many objects and reference variables are created by the following code?() Thing item, stuff; item = new Thing(); Thing entity = new Thing();
A . One object is created
B . Two objects are created
C . Three objects are created
D . One reference variable is created
E . Two reference variables are created
F . Three reference variables are created.
-
The new launch date is very tight.‘Tight’ here means not leaving enough time.
A . 正确
B . 错误
-
12. Date date = new Date(); 13. df.setLocale(Locale.ITALY); 14. String s = df.format(date); The variable df is an object of type DateFormat that has been initialized in line 11. What is the result if this code is run on December 14, 2000?()
A . The value of s is 14-dic-2004.
B . The value of s is Dec 14, 2000.
C . An exception is thrown at runtime.
D . Compilation fails because of an error in line 13.
-
An activity has an early start date-of the lOth and a late start date of the 19th. The activity also has a duration of 4 days. There are no nonworkdays. From the information given, ()what can be concluded about the activity?
-
Given: 1.d is a valid, non-null Date object 2.df is a valid, non-null DateFormat object set to the current locale What outputs the current locale’s country name and the appropriate version of d’s date?()
A . Locale loc = Locale.getLocale(); System.out.println(loc.getDisplayCountry()+ " " + df.format(d));
B . Locale loc = Locale.getDefault(); System.out.println(loc.getDisplayCountry()+ " " + df.format(d));
C . Locale loc = Locale.getLocale();System.out.println(loc.getDisplayCountry()+ " " + df.setDateFormat(d));
D . Locale loc = Locale.getDefault();System.out.println(loc.getDisplayCountry()+ " " + df.setDateFormat(d));
-
阅读下列程序,请写出该程序的功能。import java. util.*;public class Class1{public static void main(Srting args[]){Date date1=new Date();System. out. println (datel);String t=datel.toString();int endPos=t.indexOf(`C');t=t.substring(11,endPos);System. out println(t);}}
-
假设今天为2004年12月16日,以下代码的输出结果正确的是?( )public class FormatDateTime {public static void main(String[] args) {Date now = new Date();SimpleDateFormat myFmt=newSimpleDateFormat(“yyyy年MM月dd日 HH时mm分ss秒”);System.out.println(myFmt.format(now));}}
-
A banker’s acceptance is an order to pay a specified amount of money to the bearer on a given date. Banker’s acceptances have been used since the twelfth century.
-
Date date1=new Date(5000),请问说法正确( )
-
Date date1=new Date(5000),请问说法正确( )A:计算机系统公元后5秒时刻的日期和时间;B: 当前系统时间是5秒的日期和时间C:当前系统时间是5000秒的日期和时间D:计算机系统公元后5000秒时刻的日期和时间
-
下面是将一个java.util.Date对向实例送入文件的程序段,请补全Dated=newDate();FileOutputStreamf=newFileOutputStream("date.ser");___________s=new________________(f);try{s.writeObject(d);s.close();}catch(IOExceptione){e.printStackTrace();}
A.OutputStream
B.FileStream
C.ObjectOutputStream
D.ObjectInputStream
-
New and more up-to-date methods have to______(find)for collecting earthquake data and anal
New and more up-to-date methods have to______(find)for collecting earthquake data and analyzing it.
-
听力原文:A little airplane has given new meaning to the term "going hyper".The Hyper-X rec
听力原文: A little airplane has given new meaning to the term "going hyper".
The Hyper-X recently broke the record for air-breathing jet planes when it traveled at a hypersonic speed of seven times the speed of sound. That's about 5,000 miles per hour. At this speed, you'd get around the world-- flying along the equator-- in less than five hours.
The Hyper-X is an unmanned, experimental aircraft just 12 feet long. It achieves hypersonic speed using a special sort of engine. Actually, engineers have been experimenting with such an engine since the 1960s.
For an engine to bum fuel and produce energy, it needs oxygen. A jet engine, like those on passenger airplanes, gets oxygen from the air. A rocket engine typically goes faster but has to carry its own supply of oxygen. This special engine goes as fast as a rocket, but it doesn't have to carry its own oxygen supply.
Its design allows it to extract oxygen from the air that flows through the engine. And it does so without letting the fast-moving air put out the combustion flames.
A booster rocket carried the Hyper-X to an altitude of about 100,000 feet for its test flight. The aircraft's record-beating flight lasted just 11 seconds.
In the future, engineers predict, airplanes equipped with such engines could transport cargo quickly and cheaply to the edge of space. Hypersonic airliners could carry passengers anywhere in the world in just a few hours.
(36)
A.How to develop a new airplane technology.
B.Features and possible usages of a special engine.
C.How to do experiment with dangerous engines.
D.How to do experiment with unmanned airplanes.
-
A briefing is a short presentation usually given at a meeting or a conference to bring people up to date on business activities , projects , programs or procedures.
-
(专基__Js) new Date(2017,11,0).getDate()可以获取2017年11月的总天数
是
否