1
Computer Science Java Questions
with Correct Answers for Specific
Exam Mail
keywords
Ans: class, while and if are....
primitive types
Ans: which are simple values stored directly in the
memory location
reference types
Ans: which store addresses of objects stored somewhere
else in memory
static
Ans: methods not associated with any object
instance
Pretest - Stuvia US
,2
Ans: methods are part of objects and can only be called
through an object
What are the two general ways of accessing a Java
array?
Ans: direct access and sequential access
direct access
Ans: accessing an arbitrary location
sequential access
Ans: going through the entire array
compiler/syntax errors
Ans: prevent program from being compiled properly,
forgetting semicolon or braces
logic errors
Pretest - Stuvia US
, 3
Ans: are problems with what the code actually does, like
forgetting braces around else, so the code doesn't know
what to do with else
Data hiding
Ans: when an object hides its internal data from code
outside the class that the object
//is an instance of. Only the class can access its own
methods. Make fields private and methods public
data abstraction
Ans: using a class without knowing its implementation
Details
differences between array and arraylist
Pretest - Stuvia US
Computer Science Java Questions
with Correct Answers for Specific
Exam Mail
keywords
Ans: class, while and if are....
primitive types
Ans: which are simple values stored directly in the
memory location
reference types
Ans: which store addresses of objects stored somewhere
else in memory
static
Ans: methods not associated with any object
instance
Pretest - Stuvia US
,2
Ans: methods are part of objects and can only be called
through an object
What are the two general ways of accessing a Java
array?
Ans: direct access and sequential access
direct access
Ans: accessing an arbitrary location
sequential access
Ans: going through the entire array
compiler/syntax errors
Ans: prevent program from being compiled properly,
forgetting semicolon or braces
logic errors
Pretest - Stuvia US
, 3
Ans: are problems with what the code actually does, like
forgetting braces around else, so the code doesn't know
what to do with else
Data hiding
Ans: when an object hides its internal data from code
outside the class that the object
//is an instance of. Only the class can access its own
methods. Make fields private and methods public
data abstraction
Ans: using a class without knowing its implementation
Details
differences between array and arraylist
Pretest - Stuvia US