网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
给出下列java源代码: //Point x Public class Interesting{} 在源代码//point x处添加()能符合java语法
- A、import java.awt.*
- B、package local.util
- C、class MoreInteresting{}
- D、protected class MoreInteresting{}
参考答案
更多 “ 给出下列java源代码: //Point x Public class Interesting{} 在源代码//point x处添加()能符合java语法 A、import java.awt.*B、package local.utilC、class MoreInteresting{}D、protected class MoreInteresting{}” 相关考题
考题
给出下列java源代码://PointxPublicclassInteresting{}在源代码//pointx处添加()能符合java语法
A.importjava.awt.*B.packagelocal.utilC.classMoreInteresting{}D.protectedclassMoreInteresting{}
考题
下列Java源程序结构中前三种语句的次序,正确的是A.import, package, public classB.import必为首,其他不限C.public class, import, packageD.package, import, public class
考题
将下面Applet程序补充完整。import java.awt.*:import java.apptet.*;public class Hi ______ {public void paint(Graghics g) {g.drawstring("Hi!",2.5,2.5);}}
考题
在下面Java Applet程序的下画线处填入代码,使程序完整并能够正确运行。import java.applet.*;import java.awt.*;public class HelloWorld ______ {public void paint(Graphics g) {g.drawString("Hello World!",25,25);}}
考题
下列代码的下划线处应填入的方法名是______。import java.awt.*;import java.applet.*;public class Hello extends Applet{public void______(Graphics g){g.drawString("How are you!", 10, 10);}}A) repaintB) printlnC) paintD) showA.B.C.D.
考题
在如下源代码文件Test.java中, 哪个是正确的类定义?()
A.public class test { public int x = 0; public test(int x) { this.x = x; } }B.public class Test{ public int x=0; public Test(int x) { this.x = x; } }C.public class Test extends T1, T2 { public int x = 0; public Test (int x) { this.x = x; } }D.public class
考题
下列哪个选项的java源文件代码片段是不正确的?A.package testpackage; public class Test{ }B.import java. io. *; package testpaekage; public class Test { }C.import java.io.*; class Person { } public class Test { }D.import java.io.*; import java. awt.*; public class Test{ }
考题
下列( )选项的java源文件代码片段是不正确的。A.package testpackage; publicClass Test{}B.import java.io.*; package testpackage: publicClass Test{}C.import java.io.*; Class Person{} publicClass Test{}D.import java.io.*; import java.awt.*; publicClass Test{}
考题
在下列源代码文件Test.java中,正确定义类的代码是( )。A.pblic class test { public int x=0; public test(int x) { this. x=x;} }B.public class Test { public int x=0; public Test(int x) { this. x=x;} }C.public class Test extends T1,T2{ public int x = 0; public Test(int x){ this. x = x; } }D.protected class Test extends T2{ public int x = 0; public Test(int x) { this. x = x; } }
考题
下列代码的输出结果是( )。class parent{void printme(){System.out.println("parent");}}class child extends parent{void printme(){System. out.println("child");}void printall(){super, printme();this.printme();printme();}}public class test{public static void main(String args[]){child myc=new child();myc.printall();}}A.import java.awt.*;B.import java.applet.applet;C.import java.io.*;D.import java, awt.graphics;
考题
有以下程序:includeusing namespace std;definePl 3.14Class Point{private:int x,y
有以下程序: #include<iostream> using namespace std; #definePl 3.14 Class Point {private: int x,y; public: Point(int a,intB) {X=a; y:b;} int getx() <return x;} int gety() {return y;}}; class Circle:public Point {priA.314B.157C.78.5D.153.86
考题
下列哪个选项的java源文件程序段是不正确的? ( )A.package testpackage; public class Test{ }B.import java.io.*; package testpackage; public class Test{ }C.import java.i.*; class Person{} public class Test{ }D.import java.io.*; import java.awt.*; public class Test { }
考题
下列代码的下画线处应填入的方法名是( )。 import java.awt.*; import java.applet.*; public class Hello extends Applet{ public void (Graphics g){ 9.drawstring("How are you!",l0,10); } }A.repaintB.printlnC.paintD.show
考题
在下列源代码文件Test.java中, ( )是正确的类定义。A.public class test{B.public class Test{ public int x=0;public int x=0; public test (intx) public Test (int x){ {this.x=x; this.x=x;} }} }C.public class Test extends T1,T2{D.protected class Test extends T2{ public int=0;public int x=0; public Test(int x){Public Test (int x){ this.x=x;this.x=x: }} }}
考题
在下列源代码文件Test.java中,哪个选项是正确的类定义?A.public class test{ public int x=0; public test(int x ) { this.x=x; } }B.public class Test { public int x=0; public Test(int x ) { this.x=x; } }C.public class Test extends T1 T2 { public int x=0; public Test(int x){ this.x=x; } }D.protected class Test extends T2 { public int x=0; public Test(int x) { this.x=x; } }
考题
( 15 )在下列 Java Applet 程序的下划线处填入代码,使程序完整并能够正确运行。import java.applet.*;import java.awt.*;public class HelloWorld 【 15 】 {public void paint(Graphics g){g.drawString( " Hello World! " ,25,25);}}
考题
在Java语言中,在包Package1中包含包Package2,类Class_A直接隶属于包Package1,类Class_B直接隶属于包Package2,在类Class_C要应用Class_A的方法A和Class_B的方法B,你需要()语句。A、import Package1.*;B、import Package1.Package2.*;C、import Package2.*;D、import Package2.Package1.*;
考题
//point X public class foo { public static void main (String[]args) throws Exception { java.io.printWriter out = new java.io.PrintWriter { new java.io.outputStreamWriter (System.out), true; out.printIn(“Hello”); } } } Which statement at PointX on line 1 allows this code to compile and run?() A、 Import java.io.*;B、 Include java.io.*;C、 Import java.io.PrintWriter;D、 Include java.io.PrintWriter;E、 No statement is needed.
考题
下列有关类声明的代码片段,哪一项是正确的?() A、 import java.sql.*; package school; class Student{ }B、 package school; import java.sql.*; class Student{ }C、 package school; class Student{ } import java.sql.*;D、 package school; import java.sql.*;private String name; class Student{ }
考题
//point X public class foo ( public static void main (Stringargs) throws Exception { printWriter out = new PrintWriter (new ) java.io.outputStreamWriter (System.out), true; out.printIn(“Hello”); } ) Which statement at PointX on line 1 allows this code to compile and run?()A、 Import java.io.PrintWriter;B、 Include java.io.PrintWriter;C、 Import java.io.OutputStreamWriter;D、 Include java.io.OutputStreamWriter;E、 No statement is needed.
考题
// Point X public class foo { public static void main(String[] args) throws Exception { jave.io.PrintWriter out = new jave.io.PrintWriter( new jave.io.OutputStreamWriter(System.out), true); out.println(“Hello”); } } Which statement at Point X on line 1 is required to allow this code to compile?() A、 No statement is required.B、 import jave.io.*;C、 include java.io.*;D、 import jave.io.PrintWriter;E、 include java.io.PrintWriter;
考题
单选题// Point X public class foo { public static void main(String[] args) throws Exception { jave.io.PrintWriter out = new jave.io.PrintWriter( new jave.io.OutputStreamWriter(System.out), true); out.println(“Hello”); } } Which statement at Point X on line 1 is required to allow this code to compile?()A
No statement is required.B
import jave.io.*;C
include java.io.*;D
import jave.io.PrintWriter;E
include java.io.PrintWriter;
考题
单选题下列有关类声明的代码片段,哪一项是正确的?()A
import java.sql.*; package school; class Student{ }B
package school; import java.sql.*; class Student{ }C
package school; class Student{ } import java.sql.*;D
package school; import java.sql.*;private String name; class Student{ }
考题
单选题下列Java源程序结构中前三种语句的次序,正确的是( )。A
import,package,public classB
import必为首,其他不限C
public class,package,importD
package,import,public class
考题
单选题//point X public class foo ( public static void main (Stringargs) throws Exception { printWriter out = new PrintWriter (new ) java.io.outputStreamWriter (System.out), true; out.printIn(“Hello”); } ) Which statement at PointX on line 1 allows this code to compile and run?()A
Import java.io.PrintWriter;B
Include java.io.PrintWriter;C
Import java.io.OutputStreamWriter;D
Include java.io.OutputStreamWriter;E
No statement is needed.
考题
单选题//point X public class foo { public static void main (Stringargs) throws Exception { java.io.printWriter out = new java.io.PrintWriter { new java.io.outputStreamWriter (System.out), true; out.printIn(“Hello”); } } } Which statement at PointX on line 1 allows this code to compile and run?()A
Import java.io.*;B
Include java.io.*;C
Import java.io.PrintWriter;D
Include java.io.PrintWriter;E
No statement is needed.
考题
多选题给出下列java源代码: //Point x Public class Interesting{} 在源代码//point x处添加()能符合java语法Aimport java.awt.*Bpackage local.utilCclass MoreInteresting{}Dprotected class MoreInteresting{}
热门标签
最新试卷