Computer Knowledge

Java Core Classes and Threads

1,935 Questions

Java core classes and threads form the foundation of object oriented programming and are crucial for IT officer and programming exams. This includes concepts like string mutability, collections, and multithreading. Solve these questions to test your practical coding and theoretical knowledge.

String and StringBuffer classesThread execution methodsJava collections frameworkCharacter streams input outputVariable serialization rules

Java Core Classes and Threads Questions

Multiple choice
  1. getValueAt(int rowIndex, int colIndex)

  2. getColCount()

  3. setValueAt(Object aValue, int rowIndex, int colIndex)

  4. getRowCount()

  5. isCellEditable(int rowIndex, int colIndex)

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

This is the correct choice. There is no method named getColCount() in TableModel Interface. The correct method name is getColumnCount() and it returns the number of columns in a model. 

Multiple choice
  1. isLeftToRight()

  2. isRightToLeft()

  3. getCharacterCount()

  4. isVertical()

  5. getBounds()

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

This is the correct choice. There is no method named isRightToLeft() present in the TextLayout class. The correct method name is isLeftToRight() and it returns true if this TextLayout has a left-to-right base direction or false if it has a right-to-left base direction.

Multiple choice
  1. getCols()

  2. getMinimumSize()

  3. getRows()

  4. append(String str)

  5. insert(String str, int pos)

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

This is the correct choice. There is no method named getCols() present in the TextArea class. The correct method name is getColumns(), which is used to retrieve the number of columns in this text area.