object oriented programming
object oriented programming
Manjula Shenoy K
Manju.Shenoy@manipal.edu
9880651687
Do’s and don’t’s
• For attendence to be awarded, clearly answer when
your name is called. Later updation is not entertained.
• No wash room, No drinking water request etc allowed.
• Participation in class discussion about the subject when
asked for is appreciated and any help/benefit from my
side depends on this.
• Come prepared for the Lab as per Lab manual
explanation
• Observation of 200 pages record book mandatory
• Notes to be maintained in theory class
Chapter 1
Java Programming
Fundamentals
var2 = var1 / 2;
System.out.print("var2 contains var1 / 2: ");
System.out.println(var2);
}
}
Copyright © 2013 by The McGraw-Hill Companies, Inc. All
rights reserved.
A Third Example
class Example3 {
public static void main(String[] args) {
int w; // declare an int variable
double x; // declare a floating-point variable
• Example:
if(3 < 4) System.out.println("yes");
• Relational operators:
<, >, <=, >=, ==, !=
if(a < b)
System.out.println("a is less than b");
• Example:
if(w < h) {
v = w*h;
w = 0;
}
Example 1
//This is an example of single line comment
Example 2
/*This is my first java program.
This will print 'Hello World‘
as the output
*/
Indentation Practices
• The Java compiler doesn’t care about
indentation.
abstract asset boolean break byte case catch char class const
new package private protected public return short static strictfp super
switch synchronized this throw throw transient try void volatil while
s e
• Legal identifiers
• Test , x, y2, maxLoad, sample34, $up, _top
Java class Libraries
• A package which gets imported
automatically to all the java programs
• ‘java.lang’