What will be the output of the following Java program?
class String_demo
{
public static void main(String args[])
{
char chars[] = {‘a’, ‘b’, ‘c’};
String s = new String(chars);
System.out.println(s);
}
}
a) a
b) b
c) c
d) abc
Answer: d
Explanation: String(chars) is a constructor of class string, it initializes string s with the values stored in character array chars, therefore s contains “abc”.
output:
abc
Related Posts
Consider a transaction T1 that committed prior to checkpoint. The <T1 commits> record appears in the log before the <checkpoint> record. Any modifications made by T1 must have been written to the stable storage either with the checkpoint or prior to it. Thus at recovery time ____________
The system periodically performs checkpoints that consists of the following operation(s) ____________
The undo and redo operations must be _________ to guarantee correct behaviour, even if a failure occurs during recovery process.
An actual update is not allowed to a data item ____________
In the write ahead logging a _____________ is maintained.
Write ahead logging is a way ____________
The state of the data accessed by an aborted transaction must be restored to what it was just before the transaction started executing. This restoration is known as ________ of transaction.
Join The Discussion