Class as the Basis of all Computation Flashcards

1
Q

define software object

A

an object that is created while writing a java program. characteristics are data members, and behaviour are member functions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

define class

A

a class is a blueprint or template for objects that describes characteristics and behaviourwh

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

why is object instance of a class

A

an object includes the instance variables described within the class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

use of new keyword

A

to allocate space in the dynamic memory for storage of data and functions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

define instantiation

A

when an object of a class is created

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

ways of programming by using a class

A
  1. with main function
  2. without main function
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

contents of class

A
  1. external wrapper (class declaration)
  2. internal contents
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

parts of internal contents in class

A
  1. access specifiers
  2. instance variable
  3. local variable
  4. class variable
    5 constructors
  5. member methods
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

elements of external wrapper

A
  1. class
  2. class name
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

define access specifiers

A

terms used to specify the extent of usage of the class members in the program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

features of instance variables

A
  1. variables declared within the class but outside member methods
  2. same set of instance variables can be used for all objects of the class
  3. instance variables are fields of an object
  4. instance variables belonging to different objects have different values
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

class variables/static variables and instance variables difference

A

instance: no static keyword, variables are the individual copies of each object
static: static keyword, variables are a common copy for each object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

features of local variable

A
  1. declared within the body of a method
  2. can never be static
  3. scope is limited within curly braces of the method in which they are declared
  4. they are not given initial default values
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

features of member methods

A
  1. also called member functions
  2. declared public or private
  3. basically used to handle class instance variables
  4. may be parameterized to return outcome
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

define static data member

A

a static data member is a class variable which is global in the class and used commonly by all the objects of that class type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

static data member count is initialized with?

A

default value 0

17
Q

define static member method

A

uses only static data members

18
Q

what is ‘this’ keyword

A

when it is required to use the object in a member method through which it is called