Das ist ein zeitlich begrenztes Quiz.
Du hast 1 Stunde 30 Minuten um die 51 Fragen in diesem Quiz zu beantworten.
What modifier is to be used if you wish to declare that you want to no longer allow subclasses to override your variables or methods?
Finally
Abstract
Final
Synchronized
Volatile
AWT stands for
Advanced windowing tool kit
Abstract Windowing Term Kit
Abstract Windowing Tool Kit
Applet Window Tool Kit
Asynchronous windowing tool kit
Which operator is used for concatenation in java?
-
. (Dot)
*
%
+
What is the type and value of the following expression? -4 + 1/2 + 2*-3 + 5.0
int -5
double -4.5
int -4
double -5.0
In object-oriented programming, the process by which one object acquires the properties of another object is called
Encapsulation
Polymorphism
Overloading
Inheritance
Overriding
Java compiler javac translates Java source code into ………………………
Assembler language
Byte code
Bit code
Machine code
Platform dependent code
Which of the following statements about Java Threads is correct?
Java threads don’t allow parts of a program to be executed in parallel
Java is a single-threaded language
Java’s garbage collector runs as a high priority thread
Ready, running and sleeping are three states that a thread can be in during its life cycle
Every java application is not multithreaded
The wrapping up of data and functions into a single unit is called
Abstraction
Data Hiding
Message passing
In Java, declaring a class abstract is useful
To prevent developers from further extending the class
When it doesn't make sense to have objects of that class
When default implementations of some methods are not desirable
To force developers to extend the class not to use its capabilities
When it makes sense to have objects of that class
Which of the following is a member of the java.lang package?
List
Queue
Math
Stack
Process
URL stands for
Universal reader locator
Universal reform loader
Uniform resource loader
Uniform resource locator
Uniform reader locator
What is the sequence of major events in the life of an applet?
init, start, stop, destroy
start, init , stop , destroy
init, start , destroy, stop
init, start, destroy
destroy, start, init, stop
What will be the result of the expression 13 & 25?
38
25
9
12
21
What information may be obtained from a ResultSetMetaData object?
Database URL and product name
JDBC driver name and version
Number of columns in the result set
Number of rows in the result set
Number of tables in the database
Which is a special file that contains information about the files packaged in a JAR file?
Class file
Source file
Text file
Manifest file
Image file
Evaluate the Java expressions: int i=3, j=7, k=11; j + k % i
0
7
10
Which of the following provides the naming services for the server to register the object and for the client to locate the object?
Server object interface
Server implementation
RMI Registry
Server stub
Server Skeleton
Which is not a valid operator in Java?
<>
=>
<=
+=
!=
Which of the following is not an Applet method?
start()
init()
run()
stop()
destroy()
If ClassA extends ClassB, then
ClassA is a superclass
ClassB is a base class
ClassB is a subclass
ClassB is a derived class
ClassA is a base class
SSL stands for
Secure Server Layer
Secure Socket Layer
Server Socket Layer
Session Service Layer
Consider the following HTML page code: < html > < body > < a href='/servlet/HelloServlet' >POST< /a > < /body >< /html > Which method of HelloServIet will be invoked when the hyperlink is clicked?
doGet
doPost
doHref
servicePost
Stub is a ____________ proxy for the remote object.
Server side
Client side
Both side
none of the above
What is the Output: String s1 = new String("Test"); String s2 = new String("Test"); if (s1==s2) System.out.println("Same"); if (s1.equals(s2)) System.out.println("Equals");
Same Equals
Equals
Same
The code compiles, but nothing is displayed upon execution.
The code fails to compile
Which declaration of the main method below would allow a class to be started as a standalone program.
public static int main(char args[])
public static void main(String args[])
public static void main(string args[])
public static void main(String args)
Which of these are legal identifiers.
number_1
number_a
$1234
All of the above
Which of the following are keywords in Java.
implement
friend
NULL
synchronized
Given a one dimensional array arr, what is the correct way of getting the number of elements in arr.
arr.length
arr.length - 1
arr.size
arr.length()
A class can have many methods with the same name as long as the number of parameters or type of parameters is different. This OOP concept is known as
Method Invocating
Method Overriding
Method Labeling
Method Overloading
Is this True or False. In Java an abstract class cannot be sub-classed.
True
False
What is returned when the method substring(2, 4) is invoked on the string "example"? Include the answer in quotes as the result is of type String.
"xa"
"am"
"xm"
"xamp"
What is the result of evaluating the expression 14 ^ 23. Select the one correct answer.
23
24
26
Which of the following is not a return type?
boolean
void
public
Button
Which operator is used to perform bitwise exclusive or.
&
^
|
!
If result = 2 + 3 * 5, what is the value and type of result variable?
17, byte
25, byte
17, int
25, int
All the wrapper classes (Integer, Boolean, Float, Short, Long, Double and Character) in java
are final
are private
are serializable
are immutatable
What is the result of compiling and running this program? Select the one correct answer. public class test { public static void main(String args[]) { int i, j; int k = 0; j = 2; k = j = i = 1; System.out.println(k); } }
The program does not compile as k is being read without being initialized.
The program does not compile because of the statement k = j = i = 1;
The program compiles and runs printing 1.
The program compiles and runs printing 2.
A program needs to store the name, salary, and age of employees in years. Which of the following data types should be used to create the Employee class. Select the three correct answers. a. char b. boolean c. Boolean d. String e. int f. double
a,d,f
a,e,f
d,e,f
d,a,e
When we go for thread synchronization?
to remove the lock on the thread
when there is a single thread
to make a thread in sleep mode
when we want to prevent any other multiple thread to act an same object
Which statement is true? public void test(int x) { int odd = 1; if(odd) { System.out.println("odd"); } else { System.out.println("even"); } }
"odd" will always be output.
"even" will always be output.
Compilation fails.
"odd" will be output for odd values of x, and "even" for even values.
Which code determines the int value data closer to, but not greater than, a double value b?
int data = (int) Math.floor(b);
int data = (int) Math.abs(b);
int data = (int) Math.ceil(b);
int data = (int) Math.min(b);
Which of the following statements is false as far as different type of statements is concern in JDBC?
Regular Statement
Interim Statement
Callable Statement
Prepared Statement
Which of the following describes the correct sequence of the steps involved in making a connection with a database. 1. Loading the driver 2. Process the results. 3. Making the connection with the database. 4. Executing the SQL statements.
1,2,3,4
1,3,4,2
2,1,3,4
4,1,2,3
Which one not a JDBC interface?
Connection
Statement
DriverManager
ResultSet
Which one is a correct MySql Driver class name?
com.mysql.jdbc.driver.Driver
com.jdbc.mysql.Driver
com.mysql.jdbc.Driver
none of these
Which one correct JDBC statements?
PreparedStatement
CallableStatement
all of above
Where the stored procedures reside?
In side server memory
In side cache
In side database
In side browser
By default cursor pointing to-
Column Header
First Record
Last Record
Middle Record
By default "auto commit" option is -
true
false
We can get the column names using?
ResultSetColumnData
ResultSetMetaData
ResultSetHeaderData
ResultSetTableData
SELECT, INSERT, DELETE, UPDATE, COMMIT and ROLLBACK comes under ?
DML
DDL
DCL