100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CS2 Midterm Questions & 100% Verified Correct Answers with complete solutions (Latest update $7.99   Add to cart

Exam (elaborations)

CS2 Midterm Questions & 100% Verified Correct Answers with complete solutions (Latest update

 4 views  0 purchase
  • Course
  • Institution

CS2 Midterm Questions & 100% Verified Correct Answers with complete solutions (Latest update

Preview 2 out of 13  pages

  • August 28, 2024
  • 13
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
avatar-seller
CS2 Midterm
1. Java is compiled: Have to run compiler to turn java code into machine instructions (byte code)
before you run it

2. Java is statically and strictly typed: must explicitly declare type of object or variable (ex: int,
string)

3. Much more verbose

4. Faster b/c it's compiled. Does not need time to interpret code b/c it's already compiled into
machine instructions. - ANS-Java vs Python

Class! - ANS-Everything is a ____

Javac = Java Compiler

JVM = Java Virtual Machine (runs the compiled code) - ANS-Javac vs JVM

1. Java Standard Edition

2. Java Runtime Environment : The JVM and additional code for all the libraries included by
default with Java. Lets you run programs but does not let you compile them.

3. Java Development Kit: JRE + JAVAC

4. Java Archive: A zipped-up collection of all the Java classes, metadata, resources needed for
some project. - ANS-1. Java SE

2. JRE

3. JDK

4. JAR

The words and symbols you use to write a computer program and the order they must go in
relative to one another. - ANS-Syntax

Defines the general behavior and characteristics (like methods and variables) of its
instantiations (objects) or the class itself.

Must be defined with upper case! - ANS-Classes

, A function that may take in an argument, which are set by expected parameters that define what
types of input values are taken in, and are called to be done by the program - ANS-Method

1. Most basic data types that contain the purest, simplest values (ex: int, bool, float)

2. The class that the instantiation belongs to (must be declared w upper case!). Objects must
have declared Class as its type.

3. Reference types (classes) that come by default in java.lang without needing to import (most
important being String, as well as wrappers) - ANS-Data Types

1. Primitive types

2. Reference types

3. Literals

1. if-else

2. for-loop

3. while-loop

4. switch break - ANS-Control structures

1. Primitives are not objects (note lower case)

2. Primitives do not have their own methods (not a static method, not a class)

3. Cannot use keyword "new" to create a primitive (cannot be instantiated, not a class)

4. Primitives have non-null default values (ex: for int, its 0)

5. When using == != <> compare operations, you are referring to their VALUES, not their
memory locations - ANS-Primitives

Class is the type of its instantiation, or object

To instantiate a class, must use "new"

1. Reference types are objects

2. Have their own methods

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller topgradesdr. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $7.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

75057 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$7.99
  • (0)
  Add to cart