Home

Which are the valid ways to create DataInputStream streams?

A. new DataInputStream(new File("in.dat"));

B. new DataInputStream(new FileInputStream("in.dat"));

C. new DataInputStream("in.dat");

D. new DataInputStream("in.data","r");

You can do it
  1. The break statement is required in the default case of a switch selection structure.
  2. All methods in an abstract class must be declared abstract.
  3. In order to connect to a database through java program we must create _______-
  4. When we invoke repaint () for a Component, the AWT invokes the method:
  5. DriverManager.getConnection("jdbc:odbc:dsn_name") method does not depend on the class.forName(...) method.
  6. Java always provides a default constructor to a class.
  7. A panel can not be added to another panel.
  8. It is an error if a class with one or more abstract methods is not explicitly declared abstract.
  9. For all insert, update, delete, query operations on a database, ResultSet object creation is mandatory.
  10. A catch can have comma-separated multiple arguments.
  11. If a=10 and b= 15, then the statement x =(a>b)?a:b; assigns the value 15 to x.
  12. JdbcOdbcDriver is an object of Object class
  13. Consider the following code snippet: try {int x=0; int y=50/x; System.out.println("Division by zero");…
  14. In the code below, what data types the variable x can have?
  15. Servlet has ___________
  16. The name of a Java program file must match the name of the class with the extension Java.
  17. Two methods cannot have the same name in Java.
  18. A package is a collection of
  19. The programmer must explicitly create the system .in and system .out objects.
  20. Which are the valid ways to create DataInputStream streams?
  21. Throwing an exception always causes program termination.
  22. A static class method can be invoked by simply using the name of the method alone.
  23. What is java -g used for?
  24. We would like to make a member of a class visible in all subclasses regardless of what package they…
  25. Consider the following class definitions: class maths { student student1; } class student { String name;…
  26. The expression (x == y && a<b) is true If either x == y is true or a<b is true.
  27. Which of the following string can be used as mode string for creating a RandomAccessFile object?
  28. Which of the following methods can be used to remove a component from the display?
  29. Which of the following are the wrapper classes?
  30. It is perfectly legal to refer to any instance variable inside of a static method.