Sunteți pe pagina 1din 4

AdiSidaparasChapter1outline

Basiccomputingconcepts
playahugeroleinourlives
computingpowerallowsforautomationsystems,DNAanalysis,etc.
WhyProgramming?
computerscientistsuseprogrammingasatool
allcomputerscientistsworkwithalgorithms
mostimportantprocess:implementationofalgorithms
algorithmicthinking
Hardwareandsoftware
program
listofinstructionscarriedoutbycomputer
computerismoreversatilethanasimplemachine(calculator)
hardware

physicalcomponents
mainpiece:CPU(centralprocessingunit)
brainofcomputer
executesinstructions
memory(RAM)
whileexecuting,programsarestoredinRAM
accessibleanytime
limitedinsize
harddisk
permanentstorage
software
computerprograms
primarypiece:operatingsystem(OS)
softwarethatrunsonOS:application
TheDigitalRealm
digital:basedonnumbersthatincreasediscreteincrements,like
integers
binarynumber
numbercomprisedof0sand1s
base2number
Processofprogramming
code
describesprogramfragments
programexecution
actofcarryingoutinstructionscontainedintheprogram
compiler
programthattranslatesacomputerprogramwithinone
languageintoanequivalentprograminanotherlanguage
usuallyhigherlevellanguagelikemachinelanguage

AdiSidaparasChapter1outline

JavaVirtualMachine
theoreticalcomputerwhosemachinelanguageissetofJava
bytecodes
Javacodegoesthroughthis
Javaruntime
programthatexecutescompiledJavabytecodes
WhyJava?
asimple,objectoriented,networksavvy,interpreted,robust,secure,
architectureneutral,portable,highperformance,multithreaded,
dynamiclanguage
Javaclasslibraries
collectionofpreexistingJavacodethatprovidessolutionsto
commonprogrammingproblems
TheJavaProgrammingEnvironment
threebasicsteps
typeinaprogramasaJavaclass
compiletheprogramfile
runthecompiledversionoftheprogram
basicunitstorageonmostcomputersisafile
everyfilehasaname
javafiles:.javaextension
whencompiled,bytecodesaresavedinfilewithextension.class
mostIDES,twostepsarecombined
consolewindow
special,textonlywindowinwhichJavaprogramsinteractwith
theuser
Java
class
unitofcodethatisthebasicbuildingblockofJavaprograms
alwayshasunique,identifyingclassheader
method
programunitthatrepresentsaparticularaction/computation
alwayshasmethodheader
statement
executablesnippetofcodethatrepresentsacomplete
command
summary
programisstoredinaclass
inclass,therearemethods
alwaysneedaconstructormethodmain()
therearestatementsinsidemethods
StringLiterals(commonlycalledstrings)

AdiSidaparasChapter1outline

youspecifystringswithdoublequotationmarks
cannotmodifystrings
cannotspanmorethanonelineofcode
System.print.ln

printingstatement
onlyononeline
system.out.println()
escapesequences
\t:tabcharacter
\n:newlinecharacter
\:doublequotesmark
\\:backslashcharacter
workinstringliterals
printvs.println
println:forcestobeoneline/singleline
identifiersandkeywords
identifier
namegiventoanentityinaprogram,likeaclass
publicclass
Swag
{}
generallykeepmethodnamesandclassnamesincamelcase
javakeywords
cannotusetheminnamingidentifiers
comment
textprogrammersincludeinaprogramtoexplaintheircode
singleline
//
multiline
/**\
syntaxerrors
compilingerrorsdoesnotallowyoutoexecuteprogram
commonerrors
filenamedoesnotmatchclassname
misspelledwords
forgettingsemicolons
forgettingarequiredkeyword
logicerrors
commonlycalled
bugs
whenprogramdoesn'tworkthewayyouintended
proceduraldecomposition
decomposingalargeproblemintosmallerproblems
aseparationintodiscernibleparts,eachwhichissimplerthanthe
whole

AdiSidaparasChapter1outline

iterativeenhancement
processofproducingaprograminstages,addingnew
functionalityateachstage
akeyfeatureisthatyoucantesteachfeaturebeforemovingon
tonextone
staticmethods
reduceredundancy
staticmethod
blockofJavastatementsgivenaname
methodcall
commandtoexecuteanothermethod
flowofcontrol
flowofcontrol/controlflow
orderinwhichstatementsofjavaprogramareexecuted
methodsthatcallothermethods
anymethodcancallanothermethod
runtimeerror
buginyourprogramthatcausescomputerunabletorunit
structuredversion
codebrokenintomethodsandstatements
finalversionw/oredundancy
programscanbeimprovedbynotreusingstatementsmultipletimes
instead,usemethods

S-ar putea să vă placă și