Docsity

Data Structures and Algorithms in Java Chapter 1, Exams of Data Structures and Algorithms

Toggle sidebar
bg1
Data Structures and
Algorithms in Java Chapter 1:
Overview
A field of method that is private can only be accessed by - ANSMethods that
are apart of the same class.
An object is often referred to as: - ANSAn instance of a class.
Any outside entity that wants to access data in a class can do so by: -
ANSUsing a method of that class.
Execution of the program starts where? - ANSmain()
How do other parts of your program interact with objects? - ANSBy
interacting with an objects methods
How is the constructor named? - ANSIt has the same name as the class it
resides in.
Name 5 data types - ANSBLASH: binary trees, linked lists, arrays, stacks,
hash tables
object.method(); is and example of - ANSInvoking a method for a specific
object.
The keyword "new" is used to do what? - ANSCreate a new object in Java.
pf3

Partial preview of the text

Download Data Structures and Algorithms in Java Chapter 1 and more Exams Data Structures and Algorithms in PDF only on Docsity!

Data Structures and

Algorithms in Java Chapter 1:

Overview

A field of method that is private can only be accessed by - ANSMethods that are apart of the same class. An object is often referred to as: - ANSAn instance of a class. Any outside entity that wants to access data in a class can do so by: - ANSUsing a method of that class. Execution of the program starts where? - ANSmain() How do other parts of your program interact with objects? - ANSBy interacting with an objects methods How is the constructor named? - ANSIt has the same name as the class it resides in. Name 5 data types - ANSBLASH: binary trees, linked lists, arrays, stacks, hash tables object.method(); is and example of - ANSInvoking a method for a specific object. The keyword "new" is used to do what? - ANSCreate a new object in Java.

To create an object in Java you must do two things: - ANS1. Use the keyword "new"

  1. Store a reference to the object in a variable that is the same type as the class. So: Object = new ClassReference(); What are programmer's tools? - ANSData structure storage that is accessed by the program itself. Ex - stacks and queues. What do algorithms do? - ANSManipulate the data in data structures in various ways such as sorting. What does the charAt() method do? - ANSReturns a character at the specific position in the string object. What does the parse.Int() method do? - ANSConverts the string type into an integer. What is a class? - ANSA blueprint that defines an objects variables and methods. What is a constructor? - ANSA special method that is called automatically whenever a new object is created. It prepares the object for use. What is a data structure? - ANSAn arrangement of data inside a computers memory or a disk. What is an object? - ANSA software bundle of variables and related methods.