使用jdbc 编写class EnrollmentImpl 实现接口 Enrollment:public interface Enrollment{public void createStudent(Student student) throws Exception;pubic void createCourse(Course course) throws Exception;public void enroll(Student student, Course course) throws Exception;public void exam(Student, Course course, float grade) throws Exception;}

使用jdbc 编写class EnrollmentImpl 实现接口 Enrollment:

public interface Enrollment{

public void createStudent(Student student) throws Exception;

pubic void createCourse(Course course) throws Exception;

public void enroll(Student student, Course course) throws Exception;

public void exam(Student, Course course, float grade) throws Exception;

}


相关考题:

下列______选项不是InputStream类中的方法。A.public abstract int read() throws IOExceptionB.public final void writeInt (int V)throws IOExceptionC.public int available() throws IOExceptionD.public void close() throws IOException

下列程序的执行结果是______。 include class Student { public: Student(int xx){x= 下列程序的执行结果是______。include<iostream.h>class Student{public:Student(int xx){x=xx;}virtual float calcTuition( );protected:int x;};float Studertt::calcTuition( ){return float(x*x);}class GraduateStudent:public Student{public:GraduateStudent(int xx):Student(xx){}float calcTuition( );};float Graduatestudent::calcTuition( ){return float(x*2);}void main( ){Student s(20);GraduateStudent gs(30);cout<<s.calcTuition( )<<" "<<gs.calcTuition( )<<endl;//计算学生s和研究生gs的学费}

下面的代码中方法unsafe()有异常发生,那么可以加在第一行的语句为( )。 { if(unsafe()) { //do something } else if(safe()) { //do the other) } Ⅰ:public void methodName() Ⅱ:public void methodName() throw IOException Ⅲ:public void methodName() throws IOException Ⅳ:public void methodName() throws ExceptionA.Ⅲ、ⅣB.Ⅱ、Ⅲ、ⅣC.Ⅰ、ⅢD.Ⅰ、Ⅳ

下列哪个选项不是InputStream类中的方法?A.public abstract int read( )throws IOExceptionB.public final void writeInt(int v)throws IOExceptionC.pubfic void close( )throws IOExceptionD.pubfic int available( )throws IOExcepfion

下列哪个选项不是InputStream类中的方法? ( )A.public abstract int read()throws IOExceptionB.public final void writeInt(int v)throws IOExceptionC.public void close()throws IOExceptionD.public int available()throws IOException

public class SomeException {  } Class a:  public class a {  public void doSomething() { }  } Class b:  public class b extends a {  public void doSomething() throws SomeException { }  }  Which is true about the two classes?() A、 Compilation of both classes will fail.B、 Compilation of both classes will succeed.C、 Compilation of class a will fail. Compilation of class b will succeed.D、 Compilation of class a will fail. Compilation of class a will succeed.

下面哪个方法不是HttpServlet类:()A、protected void doGet(HttpServletRequest reg,HttpServletResponse res) throws Servlet Exception ,java.io.IOExceptionB、protected void doPost(HttpServletRequest reg,HttpServletResponse res) throws Servlet Exception,java.io.IOExceptionC、protected void doHead(HttpServletRequest reg,HttpServletResponse res) throws Servlet Exception,java.io.IOExceptionD、protected void doReceive(HttpServletRequest reg,HttpServletResponse res) throws ServletException,java.io.IOException

执行以下代码后,下面哪些描述是正确的() public  class  Student{  private String name = “Jema”;  public void setName(String name){  this.name = name;  }  public String getName(){  return this.name;  }  public static void main(String[] args){  Student s;  System.out.println(s.getName()); } }A、输出nullB、第10行编译报错C、第11行编译报错D、输出Jema

public class Test {  public static void aMethod() throws Exception {  try {  throw new Exception(); } finally {  System.out.println(“finally”);  }  }  public static void main(String args[]) {  try {  aMethod();  } catch (Exception e) {  System.out.println(“exception”);  }  System.out.println(“finished”);  }  }  What is the result?()  A、 finallyB、 exception finishedC、 finally exception finishedD、 Compilation fails.

1. public class Exception Test {  2. class TestException extends Exception {}  3. public void runTest() throws TestException {}  4. public void test() /* Point X */ {  5. runTest();  6. }  7. }  At Point X on line 4, which code is necessary to make the code compile?()  A、 No code is necessary.B、 throws ExceptionC、 catch ( Exception e )D、 throws RuntimeExceptionE、 catch ( TestException e)

public class ExceptionTest {   class TestException extends Exception {}   public void runTest () throws TestException {}   public void test () /* Point X*/ {   runTest ();   }   }   At point X on line 4, which code can be added to make the code compile?()  A、 Throws Exception.B、 Catch (Exception e).C、 Throws RuntimeException.D、 Catch (TestException e).E、 No code is necessary.

What is wrong with the following code?()   class MyException extends Exception {}   public class Qb4ab {   public void foo() {  try {  bar();  } finally {  baz();   } catch (MyException e) {}  }   public void bar() throws MyException {   throw new MyException();  }   public void baz() throws RuntimeException {   throw new RuntimeException();   }   }  A、Since the method foo() does not catch the exception generated by the method baz(), it must declare the RuntimeException in its throws clause.B、A try block cannot be followed by both a catch and a finally block.C、An empty catch block is not allowed.D、A catch block cannot follow a finally block.E、A finally block must always follow one or more catch blocks.

对于如下代码,描述正确的是哪项?()  class Student{   public static void main(String[] args){   Student student=new Student();  }  }  A、new Student()创建了Student对象的一个实例B、Student student声明了对象Student的一个引用C、class Student声明了一个类D、new Student()创建了一个类E、Student student 声明了一个类

现有:  class Flow {  public static void main(String [] args)   try {  System. out .print ("before") ;   doRiskyThing ( )  ;   System.out.print ("after ") ;   } catch (Exception fe) {  System.out.print ("catch") ;   }  System. out .println ( " done") ;  }  public static void doRiskyThing() throws Exception{   // this code returns unless it throws an Exception           }}  可能会产生哪两项结果 ?()  A、 before catchB、 before after doneC、 before catch doneD、 before after catch

public class Test {  public static void replaceJ(string text)  {  text.replace (‘j’, ‘l’);  }  public static void main(String args[])  {  string text = new String (“java”)  replaceJ(text);  system.out.printIn(text);  }  }      What is the result?()  A、 The program prints “lava”B、 The program prints “java”C、 An error at line 7 causes compilation to fail.D、 Compilation succeeds but the program throws an exception.

public class TestA{   public void methodA()  throws IOException{   //……   }   }   public class TestB extends TestA{   public void methodA()  throws EOFException{   //……   }   }   public class TestC extends TestA{   public void methodA()  throws Exception{   //……   }   }   当编译类TestC的时候,结果是哪项?() A、 正常B、 编译错误C、 运行错误D、 以上都不对

public class Starter extends Thread {  private int x= 2;  public static void main(String[] args) throws Exception {  new Starter().makeItSo();  }  public Starter() {  x=5;  start();  }  public void makeItSo() throws Exception {  join();  x=x- 1;  System.out.println(x);  }  public void run() { x *= 2; }  }  What is the output if the main() method is rum?() A、 4B、 5C、 8D、 9E、 Compilation fails.F、 An exception is thrown at runtime.G、 It is impossible to determine for certain.

对于如下代码,描述正确的是哪项? ()   class Student{   public static void main(String[] args){   Student student = new Student();  }  }  A、Student student 声明了一个类B、new Student()创建了Student 对象的一个实例C、Student student 声明了对象Student 的一个引用D、class Student 声明了一个类

public class TestOne {  public static void main (String[] args) throws Exception {  Thread.sleep(3000);  System.out.println(”sleep”);  }  }  What is the result?() A、 Compilation fails.B、 An exception is thrown at runtime.C、 The code executes normally and prints “sleep”.D、 The code executes normally, but nothing is printed.

单选题public class TestOne {  public static void main (String[] args) throws Exception {  Thread.sleep(3000);  System.out.println(”sleep”);  }  }  What is the result?()A Compilation fails.B An exception is thrown at runtime.C The code executes normally and prints “sleep”.D The code executes normally, but nothing is printed.

单选题1. public class Exception Test {  2. class TestException extends Exception {}  3. public void runTest() throws TestException {}  4. public void test() /* Point X */ {  5. runTest();  6. }  7. }  At Point X on line 4, which code is necessary to make the code compile?()A No code is necessary.B throws ExceptionC catch ( Exception e )D throws RuntimeExceptionE catch ( TestException e)

多选题对于如下代码,描述正确的是哪项? ()   class Student{   public static void main(String[] args){   Student student = new Student();  }  }AStudent student 声明了一个类Bnew Student()创建了Student 对象的一个实例CStudent student 声明了对象Student 的一个引用Dclass Student 声明了一个类

单选题public class Starter extends Thread {  private int x= 2;  public static void main(String[] args) throws Exception {  new Starter().makeItSo();  }  public Starter() {  x=5;  start();  }  public void makeItSo() throws Exception {  join();  x=x- 1;  System.out.println(x);  }  public void run() { x *= 2; }  }  What is the output if the main() method is rum?()A 4B 5C 8D 9E Compilation fails.F An exception is thrown at runtime.G It is impossible to determine for certain.

单选题public class TestA{   public void methodA()  throws IOException{   //……   }   }   public class TestB extends TestA{   public void methodA()  throws EOFException{   //……   }   }   public class TestC extends TestA{   public void methodA()  throws Exception{   //……   }   }   当编译类TestC的时候,结果是哪项?()A 正常B 编译错误C 运行错误D 以上都不对

单选题执行以下代码后,下面哪些描述是正确的() public  class  Student{  private String name = “Jema”;  public void setName(String name){  this.name = name;  }  public String getName(){  return this.name;  }  public static void main(String[] args){  Student s;  System.out.println(s.getName()); } }A输出nullB第10行编译报错C第11行编译报错D输出Jema

单选题public class Test {  public static void aMethod() throws Exception {  try {  throw new Exception(); } finally {  System.out.println(“finally”);  }  }  public static void main(String args[]) {  try {  aMethod();  } catch (Exception e) {  System.out.println(“exception”);  }  System.out.println(“finished”);  }  }  What is the result?()A finallyB exception finishedC finally exception finishedD Compilation fails.

单选题public class ExceptionTest {  class TestException extends Exception {}  public void runTest () throws TestException {}  public void test () /* Point X*/  {  runTest ();  }  }   At point X on line 4, which code can be added to make the code compile?()A Throws Exception.B Catch (Exception e).C Throws RuntimeException.D Catch (TestException e).E No code is necessary.