obstraction Answer: (information hiding) hiding any information that is unnecessary to the user
Encapsulation Answer: Grouping into a class of various objects along with their attributes and methods - meaning, grouping related items into a single unit. This helps handle more comp...
CSC 1351 Midterm Question And Solution
Paper 2024/2025
obstraction Answer: (information hiding) hiding any information that is unnecessary to the user
Encapsulation Answer: Grouping into a class of various objects along with their attributes and
methods - meaning, grouping related items into a single unit. This helps handle more complex types of
data, such as images and graphs.
Principle of Least Privilege Answer: A security discipline that requires that a particular user, system,
or application be given no more privilege than necessary to perform its function or job.
inheritance establishes a ____________ relationship between classes Answer: "is a"
Polymorphism Answer: when a method can take a different shape
What are the 4 operations on files? Answer: 1. Create
2. Delete
3. Read
4 Write
%d Answer: decimal integer [byte,short,int,long]
%f Answer: Floating point number [float,double]
\n Answer: new line
, \t Answer: tab space
- Answer: Left alignment (Ex - 1.23 followed by spaces)
0 Answer: show leading zeros (Ex- 001.23)
+ Answer: Show a plus sign for positive numbers (Ex - +1.23)
( Answer: Encloses negative numbers in parentheses (Ex- (1.23) )
, Answer: Show decimal separators (Ex- 12,300)
^ Answer: Convert letters to uppercase
import java.io.File Answer: tells java that you are going to use a file opener
import java.io.FileNotFoundException Answer: Allows you to import a file, even if there might be an
error, overrides java
import java.io.PrintWriter; Answer: enables you to write formatted data to an underlying Writer.
For instance, writing int, long and other primitive data formatted as text, rather than as their byte
values.
import java.util.Scanner; Answer: the import statement for the Scanner class
What 4 imports are needed for reading a file? Answer: 1. import java.io.File;
The benefits of buying summaries with Stuvia:
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
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
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 Schoolflix. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $14.99. You're not tied to anything after your purchase.