New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

Week 1 Notes - CSC 2720

by: Taylor Kahl

Week 1 Notes - CSC 2720 CSC 2720

Taylor Kahl
GPA 4.21
View Full Document for 0 Karma

View Full Document


Unlock These Notes for FREE

Enter your email below and we will instantly email you these Notes for Data Structures

(Limited time offer)

Unlock Notes

Already have a StudySoup account? Login here

Unlock FREE Class Notes

Enter your email below to receive Data Structures notes

Everyone needs better class notes. Enter your email and we will send you notes for this class for free.

Unlock FREE notes

About this Document

These notes cover everything we discussed in class on Tues 8/23 and Thurs 8/25 with corresponding textbook material from chapter 1, Review of Java Fundamentals.
Data Structures
Jaman Bhola
Class Notes
java, Packages, classes, Data_Fields, Constructors




Popular in Data Structures

Popular in Computer science

This 4 page Class Notes was uploaded by Taylor Kahl on Saturday April 23, 2016. The Class Notes belongs to CSC 2720 at Georgia State University taught by Jaman Bhola in Fall 2016. Since its upload, it has received 40 views. For similar materials see Data Structures in Computer science at Georgia State University.

Similar to CSC 2720 at GSU

Popular in Computer science


Reviews for Week 1 Notes - CSC 2720


Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 04/23/16
Notes from Tuesday 8/23 and Thursday 8/25 Following chapter 1 of the textbook Java Basics:  Java is an object-oriented language. These languages have the following properties: o Inheritance – allows a subclass to inherit code from a superclass o Encapsulation – hides the inner details of a method or class from other classes o Polymorphism – allows the same code to operate differently based on the kind of object it’s acting on  Example: “+” performs addition on numbers but concatenates Strings  Java is the only hybrid programming language, a combination of the following: o Compilable language – after compiling, programs are fully translated into machine code and immediately executable o Interpretable language – programs are translated to machine code from beginning to end as the program runs  The Java language requires programs to compile and run its programs: o JavaC – compiler o Java or JVM (Java Virtual Machine) – interpreter. Runs the class or jar file  Class files are made of byte code  Ways to write and save Java classes/files: o One file: name of the class = name of file it’s saved in o One file with one public class and private class(es): name of public class = name of file o Several files: each file’s name matches its public class. One file must contain the main() method to run the program Packages: a way to group related classes.  To write a class as part of a package: o The first line of the class code contains a package statement: package PackageName; o Give the package a different name than its classes’ names  To use classes from other packages: o Use an import statement: import PackageName.ClassName;  To import all items from a package: o import PackageName.*;  Classes in the same package can access the variables of any class in that package Classes: a data type that specifies the data & methods available for instances of that class. An object is an instance of a class. Example: a String object contains the data and methods specified by the String class  Writing a class creates a new data type with the same name as the class  A class by itself is not necessarily a program. A class with a main() method is a program  Creating a class object with the new keyword: o ClassName ObjectName = new ClassName(parameters)  The new keyword: o Creates a new object o Allocates memory for that object o Calls the class’s constructor method  Constructor – a special method which assigns values to an object’s data variables o Declaring a constructor: public ClassName(parameters) {  Constructors have no return type o A class can have multiple constructors with uinque combinations of parameters o Example: public Class Date { int day, month, year; public Date() { //constructor # 1 day = 1; month = 1; year = 2016; } public Date(int x) { //constructor # 2 day = x; month = 1; year = 2016; } public Date(int x, int y) { //constructor # 3 day = x; month = y; year = 2016; } public Date(int x, int y, int z)//constructor # 4 day = x; month = y; year = 2016; } } Data fields: items in a class; constants or variables  Access modifiers – keywords that control the availability of a data field. Only effective in a public class o public – available everywhere o private – only available within its class o protected – available within its class, subclasses and classes in the same package o most data fields in a class should be private or protected to prevent access outside classes from accessing them o public keyword is useful for data caching to make data easier to retrieve o If no access modifier is specified, data field defaults to private  Use modifiers – keywords that describe how a data field can be used o static – indicates only one value of that data field is available for the entire class class  without the word “static,” every object has its own copy of that data field and can assign different values to it  Declaring a method: o Syntax: AccessModifier UseModifier ReturnType MethodName(parameters) o Example: public static int max(int…numbers) o Above, “int…numbers” is a way to write a list of parameters of the same type as an array  Any number of int parameters can be passed to this method. They will be stored in the array named “numbers”  A method must return an expression of the return type listed in the method declaration o Unless the return type is “void” which does not return a value  Types of parameters: o Formal – an expression in the method declaration (such as “int x” or “String s”) o Argument or actual – value passed to a method when the method is called (such as “x” or “5” or “s” or “Hello”)  Enhanced for loop – convenient code for examining an entire list o Example: for(int num : numbers) { … }  This for loop will go through every element in the array “numbers” st  The 1 time through the loop, thstvariable “num” will be assigned the value of the 1 element in the array  The 2 nd time through the loop, “num” will be assigned the 2 nd value  So on until the for loop reaches the final element in the array That’s all for this week! Come back each week for more material


Buy Material

Are you sure you want to buy this material for

0 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Steve Martinelli UC Los Angeles

"There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Janice Dongeun University of Washington

"I used the money I made selling my notes & study guides to pay for spring break in Olympia, Washington...which was Sweet!"

Steve Martinelli UC Los Angeles

"There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Parker Thompson 500 Startups

"It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.