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

Java Programming

by: Agustina Price

Java Programming COP 2250

Agustina Price
GPA 3.6


Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Class Notes
25 ?




Popular in Course

Popular in Computer Programming

This 27 page Class Notes was uploaded by Agustina Price on Monday October 12, 2015. The Class Notes belongs to COP 2250 at Florida International University taught by Varadarajan in Fall. Since its upload, it has received 16 views. For similar materials see /class/221727/cop-2250-florida-international-university in Computer Programming at Florida International University.


Reviews for Java Programming


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: 10/12/15
a 5 Illuminated tive Learning Approach Herv Franceschi av Chapter 2 Programming Building Blocks Java Basics Compatible Data Types Auytypiurighuolmmhcnnigmdmmnhlm column DataTm WMTM W by star bras slum my kyle m w slur ions by M m 1013 m M oat m M m 1m my cich M Mk M m int 1mg cam Show Meet char 0M A quick review public static void 1min String args Hymn code All Java application must begin cxemitiou by calling amino public keywwd is an M speci er When a class member is Wad by the keywurd sublic than that member may be accessed 3 cade outsidathe class in which it is declared Notes The keyword static allows main to be called without having to instantiate a particular instance of the class This is necessary since main 39 by the Java interpreter before any objects are made ava compiler will compile classes that do not contain a main utt e Java interpreter has no way to run these classes Any information that you need to pass to a method is received by variables speci ed within the set of parenthesis In main there is only one parameter String args declares a parameter named args w ich is a array of instances of the class String Here args receives any command line arguments present when the program is executed String Literals Escape Sequences To include a special character in a String use an escape sequence I Scam Declare a variable mly unce Om a wrinkle is twisted its data type cannot be chmgcd Thus statements domle thCehts double twocenxs x 02 mural thin compilu mt twoCents is already defil xed Constants Value cannm change during pmgram execution Syntax 21m data39l ype constan demifier 3931 gnedVa Lue New aligning a will whm the mutant is daclzmd is aptimuL Bulawluamunbumigmd Marc the 10th in ma C onstantsd ava 2mm Mai5m wwwWJm Mmmi fo mnxm mammwmmmqmmm cw mmm W m m 2k mmwhmmi Wm mm W amw 39 v Wj im m Maw hwm nub unu r 7 0 Use all capital Idlers for constants and sepamw wards with an underscare Example final 3012le TAXRKTE 051 39 Declare mutants at the tsp of thc program 30 their valuas can easily be m 39 Declam as amp cmstant any data that sheuld not change during pmgmn in ation Advantages Constants make the code more readable 7 PI is met mming ll hm 314 Prevem pmgrammm from making logical errors An ml Expressions and Arithmetic Operators The Assignment Opumorand Expressims Arithmetic Operators I 0p mtm Prewdcnce Integer Divisim and Modulux Division by law 39 MxedType Millme and Type Casting Shortcut Opemim Assignment Operator Syntax taxgut mum expressim 096mm and Weds that evaluate to a aingk values val is than assigned ta tam umgat must be a variablc of mmt uvalue must be mpa ble with tsrgat s data type Examples int numPlayerS 1Q H numPlayera holds 10 numPlayezs 8 H nu layew now holds 8 mt legalle Ls Lat voteng leg31189 Tbmtsmnmkmml mt height umth 2 H Hugh is not defined 1nt Height 20 mdgam mfo owhg zllggal me td rename Arithmetic Operators Precedence 39 mnwmmmwm durum Example Yeu have 2 quarters 3 dimes and 2 nickcls Haw many pennies m these coins worth int pennias 2 25 3 10 2 5 58 30 10 913 Can also be writt n a3 int pennies 2 25 3 13 253 If you want to change the order of evaluation int pennies 2 25 3 1 2 5 Another Example Translate x into Java 2y incsrrmu double result x f 2 y 92 quot y 2 correct double result x X 2 y k Integer Division amp Modulus When dividing twu intagers A pafounntl in h ALU thv quotimt in at him 11 Malinda is mad 4mm To get the wmaindcr use tilt modulus opcmtm with rim mm apamuds 39 This is the can all when the dividmd and In divisor both are inmrs 1 dwblefdaublc Hunting paint division pmfnrmed by Planting Paint UniKFPU Division by Zero Image divisfcm by O Examplg in result 4 0 i No compilgr am but at run time WM gmcmm A m c xwp m and pmgram stops executing Floatingwhit divisinn by 0 Ifdividmd in nm 0 re mull i Ifmim olfdi dmdnd ivkmmb hmthmkk was nuts number Mixedfl ype Arithmetic When parfouning calculations with opamnds of diffareut data types Lawapmhiau W in prode in higinr pmkion duh tn lm ihc Gp iti n in Manned Prmna mi a MW wily Rx Mm evalmtinn was amp pennant dung Calla impliu typo citing Batten ns any Wm inching a m agpoint upermd will have a oating point nasalt Rules of Promotion Applies the rst of them rules that ts 1 Ifai mWasm5tMIso mopmldis mmmmw IfeikaaM wodmapm mnvemd ma w Ireimwmmmmwhmm muons Ifci wepam39dipmimthmwu ismnom mania Ifm lmopnnmiiudnubkmmamtgm Wmmm Explicit Type Casting Syntax data39l wei i expmession Note pamthm mud Wsim an optimal if axpmssim consists 0f 1 variable Uscfu for calculating nvmgcs IF FD FF FFF quot quotH v quotEquot g t g Shortcut Operators increment by l decrement by 1 Example Count3 1 count count 1 countquot 1 Gaunt 42mm 1 Fost x version wu myquot use value 9f var in Wan than inment or damnan Pre x versiun Var ux increment or document var than use value in upmsim More Shortcut Operators Common Error Trap No spaces are allowed between the arithmetic operawr and the equals sign Nat that 1me sequence is not t Example Add 2 m a H ima tmct a 4 2 H a 2 mamas 2 x a correct aZp Ha a z Operator Precedence x m 9432 left right parenthesis for explicit grouping right left preincremeng predecrement right left postincremeng postdecrement left right 391 quot division modulus left right addition or String 39 subtraction right left assignment


Buy Material

Are you sure you want to buy this material for

25 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

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

Kyle Maynard Purdue

"When you're taking detailed notes and trying to help everyone else out in the class, it really helps you learn and understand the I made $280 on my first study guide!"

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."


"Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

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.