CONTOH SOAL PG PROGRAMMING 1, shared by aria_putri@yahoo.com
1. In a relational data model, _________ defines the representation of the data.
A. Structure
B. Integrity
C. Language
D. SQL
2 ________ is an attribute or a set of attributes that uniquely identifies the relation.
A. A superkey
B. A key
C. A candidate key
D. A primary key
3 SQL ________ statements don’t change the contents of a database.
A. SELECT
B. UPDATE
C. DELETE
D. INSERT
4 Which of the following statements loads the JDBC-ODBC driver?
A. Class.forName(sun.jdbc.odbc.JdbcOdbcDriver)
B. Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")
C. Class.loadClass(sun.jdbc.odbc.JdbcOdbcDriver)
D. Class.loadClass("sun.jdbc.odbc.JdbcOdbcDriver")
\5 Invoking Class.forName method may throw ___________.
A. RuntimeException
B. ClassNotFoundException
C. IOException
D. SQLException
6 A database URL for an access database source test is ________.
A. test
B. jdbcodbc:test
C. jdbc:odbc:test
D. sun.jdbc:odbc:test
7 A database URL for a MySQL database named test on host panda.armstrong.edu is ________.
A. jdbc.mysql.//panda.armstrong.edu/test
B. jdbc:mysql:/panda.armstrong.edu/test
C. jdbc:mysql://panda.armstrong.edu/test
D. jdbc.mysql://panda.armstrong.edu/test
8 To connect to a local MySQL database named test, use
A. Connection connection = DriverManager.getConnection(jdbc:mysql://localhost/test);
B. Connection connection = DriverManager.connect("jdbc:mysql://localhost/test");
C. Connection connection = DriverManager.getConnection("mysql:jdbc://localhost/test");
D. Connection connection = DriverManager.getConnection("jdbc:mysql://localhost/test");
9 To create a statement on a Connection object conn, use
A. Statement statement = conn.statement();
B. Statement statement = Connection.createStatement();
C. Statement statement = conn.createStatement();
D. Statement statement = connection.create();
10 To execute a SELECT statement "select * from Address" on a Statement object stmt, use
A. stmt.execute("select * from Address");
B. stmt.executeQuery("select * from Address");
C. stmt.executeUpdate("select * from Address");
D. stmt.query("select * from Address");
11 What is the return value from
stmt.executeUpdate("insert into T values (100, 'Smith')")
A. void
B. an int value indicating how many rows are effected from the invocation
C. a value indicating whether the SQL statement has been executed successfully
D. an object that contains the status of the execution
12 Which of the following is true?
A. Any applet must be an instance of java.awt.Applet.
B. You must always provide a no-arg constructor for an applet.
C. You must always provide a main method for an applet.
D. You must always override the init method in an applet.
13 If your applet does not have the init() method, which of the following will happen?
A. Your program will not compile.
B. Your program will compile, but not execute.
C. You must have a main method.
D. Your program will run just fine since the init() method is defined in the Applet class.
14 The method that executes immediately after the init() method in an applet is __________.
A. destroy()
B. start()
C. stop()
D. run()
15 The __________ method is executed when the page becomes inactive.
A. init()
B. start()
C. stop()
D. destroy()
16 When you run an applet, which of the following is invoked first.
A. The init method.
B. The start method.
C. The stop method.
D. The destroy method.
E. The applet's default constructor
17 To use an applet in the HTML document, you use __________ in the
A. .java source code file
B. .class bytecode
C. .exe executable file
D. .html file
18 When you run the following applet from a browser, what is displayed:
import javax.swing.*;
public class Test extends JApplet {
public Test() {
System.out.println("Default constructor is invoked");
}
public void init() {
System.out.println("Init method is invoked");
}
}
A. Default constructor is invoked, then Init method is invoked
B. Init method is invoked, then Default constructor is invoked
C. Default constructor is invoked
D. Init method is invoked
19 Java applications and applets both __________.
A. have a main() method
B. are executed using the java command
C. are compiled using the javac command
D. are executed from the HTML file
20 To specify an HTML parameter named message with the value "Welcome to Java", you write the following HTML tag:
A.
B.
C.
D. None of the above.
21 To get an ImageIcon for the a specified URL, you use __________.
A. getImage(url)
B. createImage(url)
C. url.getImage()
D. url.createImage()
E. new ImageIcon(url);
22 What format of audio files are currently supported?
A. WAV
B. AIFF
C. MIDI
D. AU
E. RMF
23 To repeatedly play an instance of audio clip ac, you use __________.
A. ac.loop()
B. ac.repeat()
C. ac.repeating()
D. ac.continue()
24 To create an audio clip for a file named beep.au in the same directory of the applet, you use __________.
A. Class metaObject = this.getClass(); URL url = metaObject.getResource("beep.au"); AudioClip audioClip = Applet.newAudioClip(url);
B. URL url = this.getClass().getResource("beep.au"); AudioClip audioClip = Applet.createAudioClip(url);
C. Class metaObject = this.getClass(); URL url = metaObject.getResource("beep.au"); AudioClip audioClip = applet.createAudioClip(url);
25 To create an audio clip for a file named beep.au in the same directory of the applet, you use __________.
A. URL url = this.getClass().getResource("beep.au"); AudioClip audioClip = Applet.newAudioClip(url);
B. URL url = this.getClass().getResource("beep.au"); AudioClip audioClip = Applet.createAudioClip(url);
C. Class metaObject = this.getClass(); URL url = metaObject.getResource("beep.au"); AudioClip audioClip = applet.createAudioClip(url);
jawaban nye : AAABBCCDCB BADBCEBACC E(Semuabenar)AAA
shared by aria_putri@yahoo.com
1 comments:
If some one needs expert view regarding blogging afterward i
suggest him/her to pay a quick visit this blog, Keep
up the good job.
Feel free to visit my blog post home cellulite treatment
Posting Komentar