







































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An outline for a lecture on java programming, covering various types such as boolean, int, double, and string, as well as variables, operators, methods, and conditionals. It includes examples and explanations of concepts like division, order of operations, and conversion by casting.
Typology: Slides
1 / 47
This page cannot be seen from the preview
Don't miss anything!








































Docsity.com
Docsity.com
String a = “a”;String b = “letter b”;a = “letter a”;String c = a + “ and “ + b;
Docsity.com
Symbols that perform simple computations Assignment: =Addition: +Subtraction:Multiplication: *Division: /
Docsity.com
finalPosition
= finalPosition +
initialVelocity * fallingTime;
finalPosition
= finalPosition + initialPosition;
OR
finalPosition
= initialVelocity * fallingTime;
finalPosition
= initialPosition;
Docsity.com
Docsity.com
Docsity.com
// x = 2.
double y = 3 / (2 + 1); // y = 1.
Docsity.com
int
a = 2;
// a = 2
double a = 2;
// a = 2.0 (Implicit)
int
a = 18.7;
int
a = (int)18.7;
// a = 18
double a = 2/3;
// a = 0.
double a = (double)2/3;
// a = 0.6666…
Docsity.com
Docsity.com
Docsity.com
class
NewLine
public static void
newLine
System
. out . println
} public static void
threeLines
newLine
newLine
newLine
} public static void
main
( String
arguments
System
. out . println
( "Line 1"
threeLines
System
. out . println
( "Line 2"
Docsity.com
public static void
main
( String
arguments
System
. out . println
( "Line 1"
threeLines
System
. out . println
( "Line 2"
public static void
threeLines
newLine
newLine
newLine
class
NewLine
public static void
newLine
System
. out . println
Docsity.com
Docsity.com