100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Exam (elaborations)

CS 326 - final exam

Rating
-
Sold
-
Pages
29
Grade
A+
Uploaded on
10-08-2025
Written in
2025/2026

CS 326 - final exam e = expression f = factor start -> e ';' e -> e +/- f | f f -> f */ / atom | atom atom -> string | int "Bob" / 26 ; //could be valid string if you want it to be it is syntactically valid but semantically drugs. - answersGenerate a Grammar that is Syntactically Valid, but show an input string that would not type check. (test question from subprograms slide part 2) Conversion between primitive types and the corresponding wrapper classes is automatic. ie. int a = 10; Integer b = a; //Auto boxing (int to Integer) int c = b; // Unboxing (Integer to int) ie. Primitive Data Types: These are the basic data types in Java such as 'int' , 'double', 'char', and 'boolean'. They are not objects and do not belong to any class. They are stored efficiently and have a lower memory footprint.

Show more Read less
Institution
Cs 326
Course
Cs 326










Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Cs 326
Course
Cs 326

Document information

Uploaded on
August 10, 2025
Number of pages
29
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Content preview

CS 326 - final exam
e = expression

f = factor



start -> e ';'

e -> e +/- f | f

f -> f */ / atom

| atom

atom -> string

| int



"Bob" / 26 ; //could be valid string if you want it to be

it is syntactically valid but semantically drugs. - answers✔✔Generate a Grammar that is Syntactically
Valid, but show an input string that would not type check.



(test question from subprograms slide part 2)



Conversion between primitive types and the corresponding wrapper classes is automatic.



ie. int a = 10;

Integer b = a; //Auto boxing (int to Integer)

int c = b; // Unboxing (Integer to int)



ie.

Primitive Data Types:

These are the basic data types in Java such as 'int' , 'double', 'char', and 'boolean'. They are not objects
and do not belong to any class. They are stored efficiently and have a lower memory footprint.

,Wrapper Classes: for every primitive data type in Java, there is a corresponding wrapper class, like
'Integer' for 'int', 'Double' for 'double', 'Character' for 'char', and 'Boolean' for 'boolean'. These classes
encapsulate the primitive data type in an object allowing them to be used in places where only objects
can be utilized.



Auto Boxing - is the process where the Java compiler automatically converts the primitive type into its
corresponding wrapper class object. For example, when you type int, to - answers✔✔What is "auto-
boxing"



Has to be an object because Java weaves it into the bytecode that way. Under the hood, when calling a
generic, the generic is called an object type. Thus, it has to be that way or the program does not work -
mathematically required. The problem is objects are generally bigger and slower. Instead of using ALU -
you have to make an object to put in a variable which all takes time.. size of object + heap + field of
actual 32 bits and something to access (getter/setter/caller) which all takes up some space.




Generic is called - answers✔✔What is the potential negative about "auto boxing" in relation to Java?



Think int -> Integer



(Lec 10.19.23) Subprograms 3



The form of its expressions, statements, and program units. - answers✔✔The syntax of a programming
language is?'



ref ch 3



The meaning of those expressions, statements, and programming units. - answers✔✔The semantics of a
programming language is?

, ref ch 3



A well-designed programming language, semantics should follow directly from syntax; that is, the
appearance of a statement should strongly suggest what the statement is meant to accomplish. -
answers✔✔Why are syntax and semantics closely related?



ref ch 3



sentences or statements. - answers✔✔Strings of a language are called?



lowest-level of syntactical units. They include its numeric literals, operators, and special words, etc.



One can think of programs as strings of lexemes rather than characters - answers✔✔What are Lexemes?



ref ch 3



Identifiers - when partitioned into groups (ie. names of variables, classes, etc) - answers✔✔What are
Identifiers?



ref Ch 3



Each lexeme group that is represented by a name or token. So, a token of a language is a category of its
lexemes. - answers✔✔What are Tokens?



ref ch 3



Grammars are formal language-generation mechanisms. They commonly are used to describe the syntax
of a programming language - answers✔✔What is a grammar?



ref ch 3
$8.49
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
newborn

Also available in package deal

Thumbnail
Package deal
cs-326 quizlet with questions and answers
-
2 2025
$ 16.98 More info

Get to know the seller

Seller avatar
newborn stuvia
View profile
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
5 months
Number of followers
0
Documents
197
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

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

Frequently asked questions