Advanced Java
Advanced Java concepts including I/O streams, multithreading, exception handling, AWT/Swing, and JavaBeans APIs
Questions
Which of the following methods of Observable class returns the true value if the invoking object is modified and false if it is not?
- countObservers()
- deleteObserver()
- hasChanged()
- setChanged()
- addObserver()
Which of the following interfaces in java.beans package allows designers to change and display property value?
- DesignMode
- PropertyChangeListener
- PropertyEditor
- Visibility
- BeanInfo
Which of the following statements regarding the packages is correct in Java?
- Packages contain a single package statement.
- Packages can contain any number of import statements.
- Packages contain a single public class consisting of main() function declaration.
- Packages contain any number of classes private to the package.
- Packages can contain any number of package declarations.
Which of the following methods of Thread class waits for a thread to terminate?
- isAlive()
- join()
- run()
- sleep()
- start()
Which of the following Exception classes is used to deal with an exception of an attempt to violate the security?
- NullPointerException
- ClassNotFoundException
- IllegalAccessException
- InterruptedException
- SecurityException
Which of the following methods of Throwable class sends the stack trace to the specified stream?
- printStackTrace()
- fillInStackTrace()
- printStackTrace(PrintStream stream)
- toString()
- getLocalizedMessage()
Which of the following Exception classes is used when a requested operation is not compatible with the current thread state?
- ArithmeticException
- IllegalStateException
- IllegalThreadStateException
- ArrayStoreException
- NegativeArraySizeException
Which of the following exceptions is thrown when one thread has been interrupted by another thread?
- ClassNotFoundException
- IllegalAccessException
- InstantiationException
- InterruptedException
- NoSuchFieldException
Which of the following methods in Applet programming is used to extract the name part of an item from the class and return it?
- stop()
- getName()
- accept()
- chat()
- move()
Which of the following classes in Java contains swing version of an applet?
- JButton
- JCheckBox
- JApplet
- AbstractButton
- JLabel
Which of the following adjustment events of scroll bar is used to generate an absolute event?
- BLOCK_DECREMENT
- BLOCK_INCREMENT
- TRACK
- UNIT_DECREMENT
- UNIT_INCREMENT
Which of the following align arguments is not available in Java to be used in SwingConstants interface?
- Left
- Right
- Middle
- Leading
- Trailing
Which of the following methods of Process class in Java returns an input stream that reads input from the process out?
- destroy()
- getInputStream()
- getErrorStream()
- getOutputStream()
- exitValue()
Which of the following character methods in Java returns true value, when an argument provided with a function is in uppercase?
- isUpperCase()
- toUpperCase()
- toLowerCase()
- toTitleCase()
- isLetter()
Which of the following ByteStream classes contains methods for reading Java standard data types?
- DataInputStream
- DataOutputStream
- FileInputStream
- FileOutputStream
- BufferedInputStream
Which of the following methods in OutputStream class finalizes the output state so that the buffers are cleared?
- close()
- write()
- flush()
- reset()
- read()
Which of the following stream classes is an implementation of the output stream that uses a byte array as its destination?
- ByteArrayInputStream
- ByteArrayOutputStream
- FilteredByteStreams
- FileOutputStream
- None of these
Which of the following methods of Reader class returns true, if the next input request does not wait, otherwise returns false?
- mark()
- read()
- ready()
- reset()
- skip()
Which of the following instances of a class defined in java.beans package describes a method of a bean?
- MethodDescriptor
- ParameterDescriptor
- FeatureDescriptor
- BeanDescriptor
- PropertyDescriptor
Which of the following methods of File class removes the file associated with the invoking object, when the Java Virtual Machine terminates?
- isHidden()
- deleteOnExit()
- setReadOnly()
- accept()
- listFiles()
Which of the following methods is used in Java to suspend a thread for a period of time?
- isAlive()
- run()
- sleep()
- start()
- join()
Which of the following methods of DataInputStream class is used to read a unicode character?
- readByte()
- readChar()
- readInt()
- readBoolean()
- writeInt()
Which of the following methods of Vector class is used to return the index of the last occurrence of an element?
- isEmpty()
- lastElement()
- lastIndexOf()
- removeAllElements()
- size()
Which of the following methods is used in Java to wake up all the threads that called wait in the same object?
- wait()
- notify()
- notifyAll()
- start()
- sleep()
Which of the following stream classes in ByteStream is a combination of two or more input streams that will be read sequentially?
- PrintStream
- RandomAccessFile
- SequenceInputStream
- InputStreamReader
- OutputStream