-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
files of the lessons 23 and 24 is added
- Loading branch information
1 parent
c9cc594
commit 3343ff0
Showing
3 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
public class App { | ||
public static void main(String[] args) { | ||
User user1 = new User(); | ||
System.out.println(user1.name); | ||
User user2 = new User(); | ||
} | ||
} | ||
|
||
|
||
// Object-oriented programming in Java - برمجة كائنية التوجه | ||
// ------------------------------------------------------------------------------------------------------------- | ||
// :الهدف منها | ||
// يسهل بناء البرامج بشكل سريع في وقت قصير عبر إعادة الاستخدام امور اخرين مسبقا قاموا ببنائها | ||
// OOP makes it easy to build programs quickly in a short time by reusing things that others have already built | ||
// -------------------------------------------------------------------------------------------------------------- | ||
// Examples: امثلة | ||
// -------------------------------------------------------------------------------------------------------------- | ||
// class فئة | ||
// class object كائن/نسخة من كلاس المحدد | ||
// constructor class بناء |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
public class User{ | ||
String name = "Coder Shiyar"; | ||
|
||
User(){ | ||
System.out.println("تم انشاء ابوجكت بنجاح"); | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import java.time.LocalTime; | ||
|
||
class App { | ||
public static void main(String[] args) { | ||
System.out.println(LocalTime.now()); | ||
|
||
App2 app2 = new App2("Coder Shiyar"); | ||
} | ||
|
||
} | ||
|
||
class App2{ | ||
App2(String appName){ | ||
System.out.println("App name: "+appName); | ||
} | ||
App2(){ | ||
|
||
} | ||
App2(String appName, double version){ | ||
|
||
} | ||
} | ||
|
||
// 1: Object Oriented Programming - exampels | ||
//------------------------------------------ | ||
// 2: Classes in Java | ||
// ----------------------------------------------------------------------------------------------------------------- | ||
// قوانين لإنشاء اسماء كلاسات في جافا هي نفس قوانين إنشاء اسماء متغيرات وملفات في جافا | ||
// فقط اول حرف من اسم ينصح بان يكون حرف كبير | ||
// The rules for creating class names in Java are the same as the rules for creating variable and file names in Java, | ||
// only the first letter of a name is recommended to be a capital letter. | ||
// ----------------------------------------------------------------------------------------------------------------- | ||
// في كل ملف جافا يمكنك انشاء بها كلاس او اكثر من كلاس | ||
// بشرط ان يكون اسم احد كلاسات بنفس اسم ملف جافا الذي يتواجد بها ذلك كلاس | ||
// In each Java file, one or more classes can be created | ||
// Only the main class must have the same name as the java file in which the class is created. | ||
// ----------------------------------------------------------------------------------------------------------------- | ||
// 3: Class Constructors in Java | ||
// ----------------------------------------------------------------------------------------------------------------- | ||
// يمكن أن تحتوي كل فئة في جافا على كونستركتور واحد أو أكثر | ||
// Every class in Java can have 1 or more constructors, but the constructor header must be different | ||
// ----------------------------------------------------------------------------------------------------------------- |