• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 3 out of 30 pages
Exam (elaborations)

CSCI21 Java fully solved 2025(graded A+).

Document preview thumbnail
Preview 3 out of 30 pages

CSCI21 Java fully solved 2025(graded A+).

Content preview

CSCI21 Java fully solved
2025(graded A+)
Java Programming Language - answer - Object-oriented
programming language
- Platform independent


Java History - answer 1. 1991 - Sun Microsystems developed
language for consumer electronic devices


2. 1993 - WWW increased need for "dynamic" web pages


3. 1995 - Sun formally announces Java for Web use


Types of Java Programs - answer 1. Applications
- General-purpose programs
- Standalone
- Executed through OS


2. Applets (outdated and deprecated)
- Programs meant for WWW
- Embedded in Web page
- Normally executed through browser


Java Program Structure - answer 1. Java Program
- (optional) import declarations
- Class declaration

,2. Class
- Class name match file name
- May extend an existing class (e.g. Jcomponent)
- Contains fields and methods


Paradigm - answer - Collection of interacting objects


- Programs we specify are in these objects and how these objects
behave


Object - answer Something that has BAIT:


1. Behavior - methods (things that obj


2. Attributes - set of properties (field) w/ diff. values


3. Identity - distinct instance of a class of obj


4. Type - belongs to a class of similar objects


Object vs. Class - answer Object - instance of a class, physical entity


employee obj. = new employee();


Class - group of similar objects (blueprint of objects)


class employee { }

, EX. Class is bike, object is sports bike.


Constructor Method - answer - Special method that handles
initialization


- View as alternative to initializing fields as they are declared


Instances of Classes - answer - Single class can have multiple
instances
- Each instance is separate object that can have diff values for its
fields
- Definition of methods is same for all instances
- Only 1 class definition written as .java file for that class


What do you need to do to create Java classes? - answer Specify an
object's:


1. State: instance fields (data private to the object)


2. Behavior: methods (public interface of the class)


Instance Fields - answer - Variable - storage location that holds
value
- Variable declaration indicates variable's name (ex. balance) and
type (ex. double)
- Each object of a class holds a separate copy of instance field (ex.
diff bank accounts, diff balances)


Names (identifiers) in Java - answer - Identifier - name in program

Document information

Uploaded on
December 24, 2024
Number of pages
30
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$15.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
GUARANTEEDSUCCESS
4.3
(253)
Sold
691
Followers
314
Items
24783
Last sold
1 week ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions