Java Basics (UGC)
Tests fundamental Java concepts including multithreading, exception handling, collections, I/O streams, and syntax
Questions
Which of the following methods is used in multithreaded programming to determine if a thread is still running?
- Join
- isAlive
- Run
- Sleep
- Start
Which of the following backslash character constants is used to represent an octal character in java?
- ' '
- ''
- 'DDD'
- n
- b
Which of the following types of exception classes is used to deal with assignment to an array element of an incompatible type?
- ArithmeticException
- ArrayStoreException
- IllegalArgumentException
- IllegalStateException
- ClassCastException
Which of the following methods of Thread class is used to obtain the priority of a thread?
- run
- getName
- getPriority
- sleep
- start
Which of the following stream classes is an input stream that contains methods for reading the java standard data types?
- DataInputStream
- DataOutputStream
- FileInputStream
- FileOutputStream
- PrintStream
Which of the following methods of Float class is used to return a true value if the invoking object contains an infinite value?
- hashCode()
- isNaN()
- isInfinite()
- toString()
- byteValue()
Which of the following values in compareTo() method of String class is used to state that the invoking string is greater than the string passed as argument?
- Less than zero
- Zero
- Greater than zero
- Not equal to zero
- indexOf()
Which of the following methods of ThreadGroup class is used to return the number of groups for which the invoking thread is a parent?
- activeCount()
- destroy()
- activeGroupCount()
- checkAccess()
- getMaxPriority()
Which of the following classes in java is used to implement a dynamic array by extending AbstractList class?
- AbstractSet
- HashSet
- ArrayList
- TreeSet
- LinkedList
Which of the following methods of Package class is used to return a true value if the invoking package is sealed, or otherwise it returns false?
- getSpecificationVersion()
- isSealed()
- getName()
- getImplementationTitle()
- isSealed(URL url)
Which of the following interfaces in java enables a user to work with groups of objects and also, it is at the top of the collection hierarchy?
- List
- Set
- Collection
- SortedSet
- add()
Which of the following objects is used in java to plug around the network and have a standard way of delivering the payload?
- Proxy servers
- Client/Server
- Socket
- Internet addressing
- DNS
Which of the following tokens is a whitespace character in java?
- Newline
- Identifier
- Literal
- Comment
- Operator
Which of the following separators in java is used to separate consecutive identifiers in a variable declaration?
- ( )
- { }
- [ ]
- , (Comma)
- ; (Semicolon)
Which of the following keywords is used in multithreaded programming to ensure that no two threads access the same object simultaneously?
- wait
- notify
- notifyall
- synchronized
- break