Similar presentations:
Lecture_1
1.
OBJECT ORIENTEDPROGRAMMING IN JAVA
2.
EDUCATIONPROGRAMM
1.
Introductory lesson. Commands and the first program in Java
2.
Working with variables, int and String types
3.
Conditional operator
4.
Cycles, Arrays, Two-dimensional arrays
5.
Functions
6.
Data types. Introduction to OOP
7.
Objects
8.
Classes and static, Inner/nested classes
9.
Lists and Generics, Collections
10.
OOP: encapsulation, polymorphism
11.
OOP: Overloading, overriding, abstract classes
12.
Interfaces: comparison with an abstract class, multiple inheritance
13.
OOP: composition, aggregation, inheritance
14.
Recursion, Introduction to threads
15.
Executors
3.
About Java advantages, areas of application1.
INTRODUCTORY
LESSON.
COMMANDS
AND THE FIRST
PROGRAM IN
JAVA
Program structure, main method
Output to screen
Variables in Java
Increment and Decrement
Concatenation
Comments in code
IDE for Java
4.
ABOUT JAVA ADVANTAGES, AREAS OF APPLICATION• Advantages:
• Cross-platform
• Automatic memory management
• Application:
• Web applications
• Speed of operation (JIT compiler)
• Financial (banking) programs
• Backward compatibility
• Android applications
• Object-oriented
• Desktop applications, development
tools
• Static typing (fail-fast)
• Code as documentation
• Many open source libraries and frameworks
• Large community
• Embedded systems
5.
PROGRAM STRUCTURE,MAIN METHOD
6.
OUTPUT TOSCREEN
DIFFERENCES BETWEEN PRINTLN() AND PRINT()
Commands
What will be displayed on the screen?
System.out.println("ENU"
);
ITU
The
Best
System.out.println("The");
System.out.println("Best")
;
System.out.print("ENU"); ITUThe
Best
System.out.println("The");
System.out.print("Best");
System.out.print("ENU");
System.out.print("The");
System.out.print("Best");
ENUTheBest
7.
VARIABLES IN JAVA8.
DATA TYPES IN JAVA9.
• byte (1 byte, from -128 to 127)• short (2 bytes, from -32,768 to 32,767)
• int (4 bytes, from -2^31 to 2^31 - 1)
PRIMITIVE DATA
TYPES
• long (8 bytes, from -2^63 to 2^63 - 1)
• float (4 bytes, single-precision floating-point numbers)
• double (8 bytes, double-precision floating-point numbers)
• char (2 bytes, stores a single Unicode character)
• boolean (1 bit, stores either true or false)
10.
• Classes: either custom or built-in classes like String, ArrayList,etc.
REFERENCE (NONPRIMITIVE) DATA
TYPES
• Interfaces: define contracts that can be implemented by
classes.
• Arrays: objects that contain elements of a single type, e.g.,
int[].
• Enumerations (Enums): special classes for defining sets of
fixed constants.
11.
INCREMENT ANDDECREMENT
12.
CONCATENATION13.
StringString str1 = "Hello";
String
String str2 = "World";
String
String result = str1 + " " + str2; // "Hello World"