Home
Current Affairs January 2024

What is the correct answer?

4

To delete a file, we can use an instance of class file.

A. True

B. False

Correct Answer :

A. True


Related Questions

What is the correct answer?

4

A static class method can be invoked by simply using the name of the method alone.

A. True

B. False

What is the correct answer?

4

A package is a collection of

A. classes

B. interface

C. editing tools

D. classes and interfaces

What is the correct answer?

4

Which of the following control expressions are valid for an if statement?

A. an integer expression

B. a Boolean expression

C. either A or B

D. Neither A or B

What is the correct answer?

4

A class may be both abstract and final.

A. True

B. False

What is the correct answer?

4

JdbcOdbcDriver is an object of Object class

A. True

B. False

What is the correct answer?

4

Give file is a file object, which of the following are legal statements to create a new file.

A. file.create();

B. FileOutputStream fos=new FileOutputStream(file);

C. FileInputStream fis=new FileInputStream(file);

D. all of the above

What is the correct answer?

4

The name of a Java program file must match the name of the class with the extension Java.

A. True

B. False

What is the correct answer?

4

A variable declared inside the for loop control can not be referenced out side the loop.

A. True

B. False

What is the correct answer?

4

DriverManager.getConnection("jdbc:odbc:dsn_name") method does not depend on the class.forName(...) method.

A. True.

B. False.

What is the correct answer?

4

Which of the following string can be used as mode string for creating a RandomAccessFile object?

A. "rw"

B. "wr"

C. "0"

D. 'w''

What is the correct answer?

4

Submit button always fires doPost(...)

A. True

B. False

What is the correct answer?

4

A catch can have comma-separated multiple arguments.

A. True

B. False

What is the correct answer?

4

It is perfectly legal to refer to any instance variable inside of a static method.

A. True

B. False

What is the correct answer?

4

Every method of a final in class is implicitly final.

A. True

B. False

What is the correct answer?

4

Which of the following methods can be used to remove a component from the display?

A. remove()

B. desappear()

C. hide()

D. move()

What is the correct answer?

4

The expression (x == y && a<b) is true If either x == y is true or a<b is true.

A. True

B. False

What is the correct answer?

4

The methods wait() and noify() are defined in

A. java.lang.Thread

B. java.lang.Runnable

C. java.lang.Object

D. java.lang.ThreadGroup

What is the correct answer?

4

If you want to assign a value of 99 to the variable year, then which of the following lines can be used within an <applet> tags?

A. number=getParameter(99)

B. <number==99>

C.

D. <param = radius value ==99>

What is the correct answer?

4

The check box group class is a subclass of the component class.

A. True

B. False

What is the correct answer?

4

When X is a positive number the operations x>> 2 and x>>>2 both produce the same result.

A. True

B. False

What is the correct answer?

4

Consider the following code snippet:
try 
{
int x=0; int y=50/x;
System.out.println("Division by zero");
}
catch(ArithmeticException e)
{
System.out.println("catch block");
}

What will be the output?

A. Error. Won't compile

B. Division by zero

C. Catch block

D. Division by zero catch block

What is the correct answer?

4

If a=10 and b= 15, then the statement x =(a>b)?a:b; assigns the value 15 to x.

A. True

B. False

What is the correct answer?

4

When we invoke repaint () for a Component, the AWT invokes the method:

A. draw()

B. update()

C. show()

D. paint()

What is the correct answer?

4

When present, package must be the first no comment statement in the file.

A. True

B. False

What is the correct answer?

4

A Java monitor must either extend thread class or implement Runnable interface.

A. True

B. False

What is the correct answer?

4

Which of the following keywords are used to control access to a class member?

A. default

B. protected

C. interface

D. None of the above

What is the correct answer?

4

What is wrong in the following class definitions? 
abstract class print { 
abstract show();
}
class Display extends print {
}

A. Nothing is wrong

B. Wrong Method show() should have a return type

C. Wrong Methods show() is not implemented in Display

D. Wrong Display does not contain any members.

What is the correct answer?

4

Which exception is thrown by the read() method of InputStream class?

A. IOException

B. FileNotFoundException

C. ReadException

D. None of the above

What is the correct answer?

4

putValue(...) method takes _____________________-

A. Two arguments of object type

B. First one is of a character type and second one is of an object type

C. First one is of an object type and second one is of a character type

D. None of the above.

What is the correct answer?

4

Consider the following class definition.
Class Student extends String
{
}
What happens when we try to compile this class?

A. Will not compile because class body is not defined

B. Will not compile because class is not declared public

C. Will compile successfully.

D. Will not compile because String is abstract