Lecture Slide Week-1
Lecture Slide Week-1
PROGRAMMING
USING JAVA
Course Foundation L T P Credits
Type:
3 1 4 6
COURSE CREDITS
COURSE OUTCOME
EVALUATION COMPONENT
Edx-Object Oriented Programming in Java.
https://www.edx.org/course/introduction-to-java-programming-
starting-to-code
Coursera-Object Oriented Programming in Java Specialization.
RESOURCES https://www.coursera.org/specializations/object-
oriented-programming
▪ MIT OpenCourseWare-Introduction to Programming in Java.
https://ocw.mit.edu/courses/electrical-engineering-and-computer-
science/6-092-introduction-to-programming-in-java-january-iap-2010/
Lab Platform
CodeTantra (Continuous Labs & Exams)
IDE
LABTOOL
VS Code
Eclipse
Netbeans
IntelliJ IDEA
FUNDAMENTALS
Introduction to Java
Bytecode
JVMArchitecture
Applications of Java
OUTLINE Types of JavaApplication
History of Java
Features of Java
Simple Java Program
DataType
Variable
Variable Name
OUTLINE Operators
Precedence of Operators
Examples of Operators
INTRODUCTION TO JAVA
Fig 1: Bytecode
JVMARCHITECTURE
❑ The subscript notation in Java array can be used after type, before the variable or after the variable.
class Hello
{
public static void main(String args[])
{
System.out.println(“Hello World”);
}
};
DATATYPE
❑Use only the characters ‘a’through ‘z’, ‘A’through ‘Z, ‘0’ through ‘9’, character ‘_’, and character ‘$’.
❑ A name can’t contain space character.
❑ Do not start with a digit. Variable name can be of any length.
❑ Case sensitive.
❑ A name can not be a reserved word (A reserved word is a
word which has a predefined meaning in Java. Example: int, double, true, etc.).
VARIABLE NAME (CONT…)
❑Can you answer that whether the below lines are correct or
not?
1. int good-bye;
2. int shrift = 0;
3. char thisMustBeTooLong;
4. int bubble = 0, toil = 9, trouble = 8
5. int 8ball;
6. int double;
VARIABLE NAME (CONT…)
❑ Unary operators:
OPERATORS (CONT.…)
❑ Arithmetic operators:
OPERATORS (CONT.…)
❑ Relational operators:
OPERATORS (CONT.…)
❑ Bitwise operators:
OPERATORS (CONT.…)
❑ Logical operators:
OPERATORS (CONT.…)
❑ Assignment operators:
OPERATORS (CONT.…)
❑ Ternary operators:
❖ Conditional Operator ( ? : )
PRECEDENCE OF THE OPERATORS
EXAMPLES OF OPERATORS
EXAMPLES OF OPERATORS
Output:
❖ 10
❖ 12
❖ 12
❖ 10
EXAMPLES OF OPERATORS (CONT.…)
EXAMPLES OF OPERATORS (CONT.…)
Output:
❖ 21
EXAMPLES OF OPERATORS
(CONT.…)
EXAMPLES OF OPERATORS
(CONT.…)
Output:
❖ 40
❖5
EXAMPLES OF OPERATORS
(CONT.…)
EXAMPLES OF OPERATORS
(CONT.…)
Output:
❖ false
❖ false
EXAMPLES OF OPERATORS
(CONT.…)
EXAMPLES OF OPERATORS
(CONT.…)
Output:
❖3
EXAMPLES OF OPERATORS
(CONT.…)
EXAMPLES OF OPERATORS
(CONT.…)
Output:
❖ 16
❖ 13
❖ 52
❖ 10
EXAMPLES OF OPERATORS
(CONT.…)
EXAMPLES OF OPERATORS
(CONT.…)
Output:
❖ a == b = false
❖ a != b =true
❖ a > b =false
❖ a < b =true
❖ a >= b =false
❖ a <= b =true
THANK YOU