المساعدة - البحث - قائمة الأعضاء - التقويم
نسخة كاملة: أسئلة في الجافا
برمجة - شبكات - كمبيوتر - منتديات الفريق العربي للبرمجة > منتديات لغات البرمجة العام > منتدى مبرمجي لغة جافا JAVA > منتدى الشهادات
صفحات: 1, 2
iyadhoo
السلام عليكم:
أولاً وقبل كل شيء.. أرجو من المشرفين تغيير عنوان الموضوع إلى ما هو مناسب لأنني بصراحة لم أعرف ما هي التسمية المناسبة.. sad.gif
ثانياً : سيكون هذا الموضوع مكان طرح أسئلة في جافا للتقوية .. والمساعدة لمن أراد التحضير لأي امتحان في جافا (جامعة أو غيرها)
عندي مقترحات لتنظيم العمل إن لم تناسبكم فارموا بها عرض الحائط: tongue_smile.gif
آ- لا يوضع سؤال جديد قبل توضيح الإجابة عن الأسئلة السابقة له
ب- الأسئلة التي لا تحتمل أكثر من إجابة توضع بدون احتمالات حتى يكون هناك أفق أوسع في التفكير
ج- يحدد لكل مجموعة أسئلة يوم أو يومين قبل وضع الإجابة الصحيحة وتوضيحها(إن كانت بحاجة لتوضيح) من قبل طارح السؤال.
د- المحافظة على ترقيم الأسئلة (Q1,Q2 ...) إلى مالانهاية.

أرجو أن يتسع صدركم لكل هذا ... rolleyes.gif
بسم الله نبدأ:
كود
QUESTION NO: 1
Given:
11. int i =1,j =10;
12. do {
13. if(i++> --j) {
14. continue;
15. }
16. } while (i <5);
17. System.out.println(“i = “ +i+ “and j = “+j);
What is the result?

cool.gif
كود
Question No: 2
Given:
1. class Bigger {
2. public static void main(String[] args) {
3. // insert code here
4. }
5. }
6. class Better {
7. enum Faster {Higher, Longer};
8. }
Which, inserted independently at line 3, will compile? (Choose all that apply.)
A. Faster f = Faster.Higher;
B. Faster f = Better.Faster.Higher;
C. Better.Faster f = Better.Faster.Higher;
D. Bigger.Faster f = Bigger.Faster.Higher;
E. Better.Faster f2; f2 = Better.Faster.Longer;
F. Better b; b.Faster = f3; f3 = Better.Faster.Longer;

huh.gif
nardien28
السؤال الأول اجابته : i = 5 and j = 5 .... طبعا عرفت من الكومبايلر ان الإجابة خطأ
السؤال الثاني : C,E,F ... لست متأكدة

ليت المشرفين أو أي شخص من الإدارة أو أي عضو يساعدوننا في ايجاد فكرة لتنظيم هذه الأسئلة بحيث يسهل تصفحها من الأعضاء والزائرين
وبنفس الوقت تبقى ضمن مكان واحد يسهل الرجوع اليه
أما المواضيع الجديدة ستبعثر الأسئلة ..
iyadhoo
اقتراح .. أن يوضع موضوع مثبت لا يستطيع تعديله غير المشرفين .. يوضع فيه كل سؤال وجوابه ويتم تحديثه بشكل متكرر!


وهنا يتم وضع الاسئلة الجديدة ومناقشة الاجوبة
العيافـي
السؤال الاول يكون الناتج
i=5
J=6
سبق ومر علي في احد الاختبارات.



كود
ليت المشرفين أو أي شخص من الإدارة أو أي عضو يساعدوننا في ايجاد فكرة لتنظيم هذه الأسئلة بحيث يسهل تصفحها من الأعضاء والزائرين
وبنفس الوقت تبقى ضمن مكان واحد يسهل الرجوع اليه
أما المواضيع الجديدة ستبعثر الأسئلة ..


يفتح قسم خاص لهذه الاسئلة ويكون كل سؤال في موضوع جديد

حيث يكون هذه القسم فرعي لمنتدى مبرجي لغة الجافا.

وسلامتكم
مجدي محمود
إقتباس
ليت المشرفين

شو انت يا nardien28 rolleyes.gif
ان شاء الله سارتبها بموضوع واحد الليلة
nardien28
يا مجدي كنت أقصد التداول حول فكرة مناسبة لترتيبها .. تريح الجميع ةتراعي نقطتين :
سهولة التصفح وفي نفس الوقت بقائها ضمن مكان واحد .
الأسئلة كانت موجودة سلفا في موضوع "اختبر نفسك مع جافا" وهذه أول مشاركة خارجه
أستطيع بسهولة ضمها ودمجها معه دون سؤال أحد ..
لكني أردت المشورة قبل قيامي بأي عمل اداري
iyadhoo
أين بقية الأعضاء؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟
malek_sa
إقتباس
أين بقية الأعضاء؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟

مشغولون بالوظائف و المذاكرات sleep.gif wacko.gif
iyadhoo
يبدو أنه ما من مهتم .. فقط إجابة ونصف ومضى على الموضوع أكثر من أسبوع.
الأجوبة...
بالنسبة للجواب الأول
i=5 و j=6 .. أحسنت أخي ali بارك الله فيك
بالنسبة للسؤال الثاني الإجابة الصحيحة C,E .. أحسنت مشرفتنا سأعتبر إجابتك صحيحة وأعطيك علامة عليها !! laugh.gif
بقية الأعضاء سيأخذون صفراً على هذه الأسئلة . لعدم مشاركتهم..
فقط فتحنا موضوع جديد عالفاضي!!!!!!!!!!!!!!!!!!!!!!!!!!
Eisa Ayed
كود
Given the following variables

char c = 'c';
int i = 10;
double d = 10;
long l = 1;
String s = "Hello";

Which of the following will compile without error?

1  c=c+i;  
2  s+=i;  
3  i+=s;  
4  c+=s;




كود
What will happen when you attempt to compile and run the following code?
import java.util.*;
public class BinFind{
    public static void main(String argv[]){
        new BinFind();
   }
    BinFind(){
        ArrayList<String> al = new ArrayList<String>();
        al.add("USA");
        al.add("Algeria");
        al.add("China");
        Collections.sort(al);
    int iOffSet= Collections.binarySearch(al,"China");
        System.out.println(iOffSet);
    }
}




أياد سامحني على الغياب ،
العيافـي
السؤال الاول : 2

اما السؤال الثاني كنت على يقين بان الترتيب الترتيب الجديد سيكون بالشكل التالي
Algeria
China
USA
ولكنى اخطأت في رقم index حيث بدات الترقيم من الواحد (هعهع)
nardien28
اضفت استفتاء ...
HaCKEr_GIrl
بالنسبة للسؤال الاول
كود
11. int i =1,j =10;
12. do {
13. if(i++> --j) {
14. continue;
15. }
16. } while (i <5);
17. System.out.println(“i = “ +i+ “and j = “+j);
What is the result?

حيفحص الشرط
كود
if(i++> --j)

القيمة1>9 النتيجة لا فلا يتحقق الشرط ؟؟كيف سيكمل الloop
العيافـي
بالاضافة الى جعل كل سؤال في موضوع مستقل، أقترح تثبيت موضوع يحتوي على روابط جميع الاسئلة.

اما بالنسبة لاجابة الاخت HaCKEr_GIrl
فيبدوا انها لم ترى شرط while i<5
حسام الملحم
لقد شاركت في الاقتراع،،

لكني أرى فتح قسم جديد توضع فيها الأسئلة، وكل موضوع يحوي سؤالا.
بهذا رتبنا الأسئلة ولم تعد مبعثرة، وفي قسم واضح، وبهذا نستطيع تصفح الأسئلة بعناوينها، ولا سيما أننا نستطيع تقييم الأسئلة وصعوبتها بإضافة النجوم إلى كل سؤال.

لقد وضعت تقييما نجوميا لهذا الموضوع مثلا!

بالتوفيق!
HaCKEr_GIrl
المشكلة كانت عندي عدم تركيزي في تتبع الاقواس
مشكورين
iyadhoo
السؤال الثالث ... 2
السؤال الرابع ... 1
Eisa Ayed
كود
Given the following code, which of the options added individually will allow the code to compile?
public class ChinaHearts{
    public static void main(String argv[]){
    System.out.println("I'll miss you" + h);
   }
}


  1 char h = 1; //on the line before the System.out.println statement.  
  2 static char h = 1; //On the line before the System.out.println statement  
  3 char h = 1;//On the line before the main method  
  4 static char h = 1;//On the line before the main method
nardien28
4 ,1 ... والله اعلم
HaCKEr_GIrl
1 و4
العيافـي
إقتباس(nardien28 @ Dec 8 2006, 11:07 PM) [snapback]574815[/snapback]
4 ,1 ... والله اعلم
Eisa Ayed
السلام عليكم

فعلاً 1 و 4

طيب

كود
What will happen when you attempt to compile and run the following code?
class Computer{
    protected static String sCpuType;
    Computer(){
    sCpuType="i386";
    }

}

class Laptop extends Computer{
    public String sCpuType="AMD Duron";
    public static void main(String argv[]){
    new Laptop();

    }
    Laptop(){
    
    System.out.println(Computer.sCpuType);
    System.out.println(sCpuType);
    }
}


  1 Compile time error caused by call Computer.sCpuType, no class reference Computer exists
  2 Compile time error, sCpuType is protected and thus not visible within class Laptop
  3 Compilation but runtime exception, sCpuType will not be visible until the class Computer is constructed
  4 Compilation, and output of i386 followed by AMD Duron at runtime



كود
What will happen if you attempt to compile and run the following code?

class Base{}
class CatMat{
    int i = 99;
    int j= 100;
    public static void main(String argv[]){
    new CatMat(new Base());

    }
    public void alex( final int i){
    System.out.println(i+j);
    
    }
    CatMat( Object o){
    alex(1);
    }
}

1   Compile time error, code within main method is faulty.  
2  Compile time error, Catmat is expecting Object but is sent Base  
3   Compile time error Catmat(Object o) has no return type  
4   Compile time error the a final variable cannot be used with the + operator and a non final variable.  
5   Compilation and output of 100  
6   Compilation and output of 101
iyadhoo
الأول 4 والثاني 6 والله أعلم...
iyadhoo
up up up
iyadhoo
كود

Given:
1. class Example {
2. public static void main(String[] args) {
3. Short s = 15;
4. Boolean b;
5. // insert code here
6. }
7. }
Which, inserted independently at line 5, will compile? (Choose all that apply.)
A. b = (Number instanceof s);
B. b = (s instanceof Short);
C. b = s.instanceof(Short);
D. b = (s instanceof Number);
E. b = s.instanceof(Object);
F. b = (s instanceof String);


ممل جداً أن يتحاور الشخص مع نفسه .. لكنه قد يضطر خصوصاً إذا كان في منتدى الجافا mad.gif ا
أتمنى ألا أدخل يوماً إلى هذا الموضوع .. فأرى الغبار يعلوه .. وخيوط العناكب تحيط به ... وفهمكم كافي mad.gif
Eisa Ayed
أنا أعتذر على عدم مواصلتي لأنني مركز على java 2D

أخي أياد مارأيك أن نغير طريقة الأسئله

لماذا لانتدارس في شئ متعمق نوعاً ما ( وافضـّل في الشبكات ) ، أي شئ ترى فيه بعض المشاكل ضعه هنا لـنحاول فهمه وتحسينه ان امكن

يكفي فقط رؤوس أقلام ، يعني مثلاً syncrounized methods أو أي شئ يخطر في بالك و بال من يشاهد الموضوع ،
الشمري
أسئلة ماهي المخرجات وأين الخطأ .. عندي عقدة منها regular_smile.gif .. ولكن هي أسئلة بسيطة .

--
أخوي iyadhoo : تعوذ من الشيطان teeth_smile.gif والله يا اخوي الوقت مافيه ,,, أفضل شيء تحط سؤال وتلميحه لاجابته فقط للافادة ..


أنا عندي كم هائل من الاسئلة .. جاوبت عليها .. سأقوم برفعها هنا . . طبعا هي أسئلة دكاترة ,, وكلها تتمحور حول رصيد في بنك ومشكلة في مطعم و طالب اخذ +A او +F .

لكن لا اعلم .. هل ارفعها او لا .. يعني هل نعطي واجبات محلولة .. أو هذا مو من صالح الطلاب ,,
iyadhoo
أهلا أخي الشمري..
بصراحة كان هدفي من هذا الموضوع -بعد مبادرة مشرفتنا nardien- هو تكوين "بنك أسئلة" متنوعة تشمل أساسيات جافا أو مستويات متقدمة منها.. بحيث يستفيد منها كل الأعضاء وتكون مرجع لمن يريد التقدم لامتحانات في جافا سواء في الجامعة أو scjp .. وأيضاً يكون هناك شيء من التفاعل في هذا المنتدى النائم !!..
لكن إلى الآن لم يهتم أحد من المشرفين لترتيب الأسئلة..!!
Eisa Ayed
كود
What will happen when you attempt to compile and run the following code?
abstract class Base{
    int iSize;
    public int getAge(){
    return iSize;
    }

}
class Jewel extends Base{
    private int iAge=99;
}

public class KDierden extends Jewel{

    public static void main(String argv[]){
    new KDierden();
    }
    private KDierden(){
    System.out.print(iAge);
    }

}


  1 Compile time error because an abstract class cannot have non abstract methods.
  2 Compile time error, a constructor may not be marked as private
  3 Compilation and output of 99
  4 Compile time error, iAge is not visible within class KDierde



كود
What will happen when you attempt to run and compile the following code?

public class SandCar extends Thread{
    public static void main(String argv[]){
        SandCar s = new SandCar();    
    }
        SandCar(){
            Lil.Burg lb = new Lil().new Burg();
            lb.start();
        }

    public void Sierra(){}

}

class Lil  {
    class Burg extends Thread {
        public void run(){
        iona();        
    }
        
        public void iona(){
                try{
                    wait();
                }catch(InterruptedException ioe){}
                notifyAll();
                System.out.println("Chris");
            }

        }        
    
}

abstract interface PCar{
        public void Sierra();
}



1   Compile time error, malformed syntax for creation of instance lb in SandCar constructor  
2   Compilation but no output at runtime  
3   Compilation and output of "Chris"  
4   Compilation but runtime exception


كذلك ماهو access modifier في الكلاس Lil ؟


الشمري اذا كانت اسئلتك فيها تفكير ومعقده اطرحها بغض النظر وجود حلول أو لا
nardien28
إقتباس
لكن إلى الآن لم يهتم أحد من المشرفين لترتيب الأسئلة..!!

هأرتبهم يا اياد .. بس صبرك عليا ..
لما تخلص الامتحانات هشوفلهم حل
المهم لا تعصب ... وشكرا لإياد وعيسى لمشاركتهم الدائمة في هذا الموضوع
iyadhoo
إقتباس
هأرتبهم يا اياد .. بس صبرك عليا ..
لما تخلص الامتحانات هشوفلهم حل
المهم لا تعصب ...


ماشي ... ماني معصب أبداً angry: mad.gif mad.gif...........
laugh.gif
المهم تمضى الامتحانات على خير .. بالتوفيق إن شاء الله للجميع ..
على كل سأقوم بترتيب الأسئلة في ملفات pdf وسأضع كل 50 سؤال معاً مع أجوبتها وأرفعها في القريب بإذن الله.

أخ عيسى أهلا وسهلا بعد طول غياب !!
السؤال الأول 4
السؤال الثاني ..ممممم قد يكون 2
Lil له محدد الوصول default ..
والله أعلم!
regular_smile.gif
Eisa Ayed
السؤال الثاني خطأ ،

تابع معي Thread Life Cycle :




والخطأ الذي يظهر هو كالتالي :

java.lang.IllegalMonitorStateException

وهذا الخطأ يظهر عندما تعمل call لتغيير حالة thread وتكون هذه الحاله لايمكن تنفيذها الآن على thread

مثلاً عندما تعمل Thread1.wait()

قبل Thread1.start()

سيظهر الخطأ java.lang.IllegalMonitorStateException
Eisa Ayed
كود
1. What is the difference between an Abstract class and Interface ?
2. What is user defined exception ?
3. What do you know about the garbage collector ?
4. What is the difference between C++ & Java ?
5. Explain RMI Architecture?
6. How do you communicate in between Applets & Servlets ?
7. What is the use of Servlets ?
8. What is JDBC? How do you connect to the Database ?
9. In an HTML form I have a Button which makes us to open another page in 15 seconds. How will do you that ?
10. What is the difference between Process and Threads ?
11. What is the difference between RMI & Corba ?
12. What are the services in RMI ?
13. How will you initialize an Applet ?
14. What is the order of method invocation in an Applet ?
15. When is update method called ?
16. How will you pass values from HTML page to the Servlet ?
17. Have you ever used HashTable and Dictionary ?
18. How will you communicate between two Applets ?
19. What are statements in JAVA ?
20. What is JAR file ?
21. What is JNI ?
22. What is the base class for all swing components ?
23. What is JFC ?
24. What is Difference between AWT and Swing ?
25. Considering notepad/IE or any other thing as process, What will happen if you start notepad or IE 3 times? Where 3 processes are started or 3 threads are started ?
26. How does thread synchronization occurs inside a monitor ?
27. How will you call an Applet using a Java Script function ?
28. Is there any tag in HTML to upload and download files ?
29. Why do you Canvas ?
30. How can you push data from an Applet to Servlet ?
31. What are 4 drivers available in JDBC ?
32. How you can know about drivers and database information ?
33. If you are truncated using JDBC, How can you know ..that how much data is truncated ?
34. And What situation , each of the 4 drivers used ?
35. How will you perform transaction using JDBC ?
36. In RMI, server object first loaded into the memory and then the stub reference is sent to the client ? or whether a stub reference is directly sent to the client ?
37. Suppose server object is not loaded into the memory, and the client request for it , what will happen?
38. What is serialization ?
39. Can you load the server object dynamically? If so, what are the major 3 steps involved in it ?
40. What is difference RMI registry and OSAgent ?
41. To a server method, the client wants to send a value 20, with this value exceeds to 20,. a message should be sent to the client ? What will you do for achieving for this ?
42. What are the benefits of Swing over AWT ?
43. Where the CardLayout is used ?
44. What is the Layout for ToolBar ?
45. What is the difference between Grid and GridbagLayout ?
46. How will you add panel to a Frame ?
47. What is the corresponding Layout for Card in Swing ?
48. What is light weight component ?
49. Can you run the product development on all operating systems ?
50. What is the webserver used for running the Servlets ?
51. What is Servlet API used for connecting database ?
52. What is bean ? Where it can be used ?
53. What is difference in between Java Class and Bean ?
54. Can we send object using Sockets ?
55. What is the RMI and Socket ?
56. How to communicate 2 threads each other ?
57. What are the files generated after using IDL to Java Compilet ?
58. What is the protocol used by server and client ?
59. Can I modify an object in CORBA ?
60. What is the functionality stubs and skeletons ?
61. What is the mapping mechanism used by Java to identify IDL language ?
62. Diff between Application and Applet ?
63. What is serializable Interface ?
64. What is the difference between CGI and Servlet ?
65. What is the use of Interface ?
66. Why Java is not fully objective oriented ?
67. Why does not support multiple Inheritance ?
68. What it the root class for all Java classes ?
69. What is polymorphism ?
70. Suppose If we have variable ' I ' in run method, If I can create one or more thread each thread will occupy a separate copy or same variable will be shared ?
71. In servlets, we are having a web page that is invoking servlets username and password ? which is checked in the database ? Suppose the second page also If we want to verify the same information whether it will connect to the database or it will be used previous information?
72. What are virtual functions ?
73. Write down how will you create a binary Tree ?
74. What are the traverses in Binary Tree ?
75. Write a program for recursive Traverse ?
76. What are session variable in Servlets ?
77. What is client server computing ?
78. What is Constructor and Virtual function? Can we call Virtual function in a constructor ?
79. Why we use OOPS concepts? What is its advantage ?
80. What is the middleware ? What is the functionality of Webserver ?
81. Why Java is not 100 % pure OOPS ? ( EcomServer )
82. When we will use an Interface and Abstract class ?
83. What is an RMI?
84. How will you pass parameters in RMI ? Why u serialize?
85. What is the exact difference in between Unicast and Multicast object ? Where we will use ?
86. What is the main functionality of the Remote Reference Layer ?
87. How do you download stubs from a Remote place ?
88. What is the difference in between C++ and Java ? can u explain in detail ?
89. I want to store more than 10 objects in a remote server ? Which methodology will follow ?
90. What is the main functionality of the Prepared Statement ?
91. What is meant by static query and dynamic query ?
92. What are the Normalization Rules ? Define the Normalization ?
93. What is meant by Servlet? What are the parameters of the service method ?
94. What is meant by Session ? Tell me something about HTTPSession Class ?
95. How do you invoke a Servlet? What is the difference in between doPost and doGet methods ?
96. What is the difference in between the HTTPServlet and Generic Servlet ? Explain their methods ? Tell me their parameter names also ?
97. Have you used threads in Servlet ?
98. Write a program on RMI and JDBC using StoredProcedure ?
99. How do you sing an Applet ?
100. In a Container there are 5 components. I want to display the all the components names, how will you do that one ?
101. Why there are some null interface in java ? What does it mean ? Give me some null interfaces in JAVA ?
102. Tell me the latest versions in JAVA related areas ?
103. What is meant by class loader ? How many types are there? When will we use them ?
104. How do you load an Image in a Servlet ?
105. What is meant by flickering ?
106. What is meant by distributed Application ? Why we are using that in our applications ?
107. What is the functionality of the stub ?
108. Have you used any version control ?
109. What is the latest version of JDBC ? What are the new features are added in that ?
110. Explain 2 tier and 3 -tier Architecture ?
111. What is the role of the webserver ?
112. How have you done validation of the fields in your project ?
113. What is the main difficulties that you are faced in your project ?
114. What is meant by cookies ? Explain ?
iyadhoo
الله يجزيك الخير أخ عيسى بصراحة الأسئلة جميلة جداً .. وعلينا التعاون في الإجابة عليها ..
لكن ... بعد الامتحانات
Eng_Gaza
iyadhoo
{عيسى}
وجميع المهتمين في هذا المنتدى الرائع : شكرا جزيلا لكم
مجهودكم جبار ومافي تعب يروح ع الفاضي
ولا تنتظر ردود كثيرة من الأعضاء بحلول الأسئله , لكن ندعوا الله لكم بالتوفيق أحسن من كل شيء

أرى أرشفتها في ملفات PDF أو أي طريقة لترتيب الأسئلة ستكون فعلا بنك من أسئلة الجافا
ولكن أتمنى أن يراعى في ذلك مستوى صعوبة الأسئلة (مبتدئ - متوسط - محترف)
وتأكدوا انها خطوة ستجزون عليها جزاءٌ عظيما ( أعظم مهنه هي التعليم ). . .




نعود إلى الأسئلة :
السؤال الأول:


What is the output of the recursive function printStuff(4) ?S



كود
static void printStuff(int level) {
            if (level == 0) {
               System.out.print("^");
            }
            else {
               System.out.print("(");
               printStuff(level - 2);
               System.out.print("/");
               printStuff(level - 2);
               System.out.print(")");
            }
        }




-------------------------


السؤال الثاني:


Trace through the function Func to compute the value of Func(3) and Func(20). ?S


كود
int Func(int x) {    
if (x >20)
        return x-10;
else
        return Func( Func( x + 11) );
}





مستوى الأسئلة : مبتدء إلى متوسط .
Eisa Ayed
سؤالك الاول تتبعته إلى هذا الحد وطلعت بالتالي ((^/^)/(^/^

لو كانت لدي ورقه وقلم لأكملت ولكن بدون ورقه ضعت في نهايته
Eisa Ayed
هل بالامكان أن يبدأ شخص في تحديد بعض الأسئله من 114 سؤال في مشاركتي السابقه

لأنني محتار أبدأ في أي واحده ، ليبدأ أحدكم وأكمل معه الاسئله وإياد اين أنت ؟
Eisa Ayed
السلام عليكم

هذه حلول بعض الاسئله الخفيفه ، بعض الاسئله لم أعرف لها جواب والآخر حلها يريد شرح طويل ، مع مرور الوقت سننتهي منها باذن الله

What do you know about the garbage collector ?

الكل يعرف بأننا نستطيع إنشاء اوبجكت عن طريقة الكيوورد new

ولكن بعد مانكون قد انتهينا من استخدام هذا الاوبجكت كيف نقوم بمسحه ؟ نحتاج مسحه لأن لدينا ميموري محدوده (تخيل أن لديك كلاس كبير جداً مثلاً LinkedList معقده جداً فاعملية انشاء اوبجكت منه سوف تحجز مساحه كبيره )
garbage collection الموجوده في JVM تضمن لنا أنه بعد استخدام هذا الاوبجكت null referencing سوف تقوم JVM بمسح هذا الاوبجكت والتخلص منه . وهنا نكون قد استفدنا من مساحة الميموري وكذلك لم ندخل في متاهات allocation and deallocation التي يعاني منها مبرمجين اللغات التي لاتحتوي على garbage collection ( مثل الرسائل التي تظهر مشكله في الميموري أو انه يحاول الحجز بمكان محجوز مسبقاً ) .

للاستزاده http://www.artima.com/insidejvm/ed2/gc.html


What is the difference between RMI & Corba ?

حسب خبرتي البسيطه جداً بأن RMI remote method invocation تستخدم لعمل distributed computation
في موقع صن هناك tutorial على هذه التقنيه وهو عباره عن حساب قيمة الثابت الرياضي PI .
تخيل بأنك تريد عمل عمليات رياضيه معقده وجهازك لايملك القدره على عملها ، فالحل انك تقوم بعمل هذه العمليات المعقده على جهاز آخر يملك قدرات هائله لمعالجة البيانات ويرجع بالنتيجه . الجميل في الـRMI انك تقوم بعمل هذه العمليات كما لو كان هذا الاوبجكت يعمل في جهازك وهو حقيقة يعمل في سيرفر بعيد عنك ، الاوبجكت الذي نقوم باستدعائه من السيرفر يسمى Remote Object ، هذه فائدة RMI باختصار

CORBA Common Object Request Broker Architecure

تأتي لحل مشكلة heterogeneity في النظم الموزعه ، تخيل أنك في شبكه وانت تعمل على نظام ويندوز والآخر يعمل على نظام سولاريز وتريد الشركه أن تقدم لكم خيارات موحده أو خدمات واحده ، فالـCORBA تقوم بحل مشكلة الاختلاف سواءاً في الهاردوير أو السوفتوير .
CORBA تعمل كـ middleware أي فوق نظام التشغيل وتحت الApplication


Have you ever used HashTable and Dictionary ?

الاسئله اسئلة مقابله لذلك سنجيب عن ماهية الاثنتين ، أنا حقيقة لم استخدم ولا وحده منهن في برامجي laugh.gif

لكن دعونا نرى ماهي
Dictionary عباره عن Abstract class وهو الأب للـHashTable يقوم على تمثيل القيم بأساس أنها keys and values وجميعهن أوبجكت

HashTable هو نفس HashMap ولكنه لايقبل null values وكذلك جميع المثدز syncrounized



How does thread synchronization occurs inside a monitor ?

لم افهم السؤال جيداً ولكن سأجيب بما فهمت .

عندما نعمل syncrounized keyword على مثد أو على بلوك فإننا نضمن بأن هذه المثد لن يقوم بتنفيذها إلا one thread at a time

الثريد عندما ياتي لـmethod يعمل lock على الاوبجكت ولايفلته إلا بinterrupt or wait



What is the RMI and Socket ?

Socket نستطيع القول بأنها برنامج يجعلك تتخاطب مع السيرفر عن طريق إرسال المسج أو الاوبجكت

RMI تحتوي على Socket بالاضافه إلى اشياء أخرى مثل RMI registry & stubs


What is meant by distributed Application ? Why we are using that in our applications ?

Distributed application في الApplication التي نعملها فإننا نقوم بعملها على جهاز واحد يملك جميع المقدرات والعتاد للقيام بمهمة برنامجنا
في الـDistributed System نقوم بعمل الApplication على مستوى اكثر من جهاز وتظهر النتائج وكأن البرنامج اشتغل على جهاز واحد وهنا نستفيد أننا قد تفادينا مسألة Centralized الموجوده في الشبكات حالياً ، بمعنى أنه لو حصل عطل في جهاز واحد لن يذهب البرنامج ونبدأ من جديد ،
نحتاجه لأنه قد نحتاج إلى services من اجهزه متعدده أو نريد عمليات في اجهزه بعيده عنا ونريد ان كل جهاز يقوم بمهمه معينه ويسلمها للجهاز الذي يتبعه وهكذا حتى نأتي بالنتائج . مثال على Distributed application methodology هي RMI and CORBA


Explain 2 tier and 3 -tier Architecture ?


أها ، على كثر ماقريت عن 3 tier and n tier إلا اجد انني اتوه فيها ، ولكن فلسفتها تقول

ان هناك 3 طبقات
اول طبقه تعبر عن presentation layer وهي طبقة العرض وعادة تكون GUI or dynamic pages
الطبقه الثانيه تكون عباره عن brocess data or problem domain layer ونقوم فيها بحل المشكله وتعريف الclasses المناسبه لهذا البرنامج
الطبقه الثالثه تسمى بالdata access وهي التي نقوم فيها بعمليات الحفظ في قاعدة البيانات واسترجاع المعلومات منها

فعندما نريد تغيير الواجهه نغير فقط في GUI tier ، عندما يأتينا extention جديد للمشكله نغير في process data tier


أتمنى ان تكون اجاباتي شافيه وأرحب بأي ملاحظه او تصحيح أو إثراء للمعلومات وحتى لو كانت بسيطه أو نقاش أو اي شي بس خلونا نتناقش sad.gif
Eisa Ayed
up up up
Eisa Ayed
خلال شهر كامل لم يتم مناقشة اي موضوع

كنت أعتقد انه سياتي احد ليثير سؤال معين ضمن 114 سؤال ، ولكن يبدو كعادتي اخاطب نفسي
Eisa Ayed
برأيكم لماذا Hashtable وليس HashTable ??

لماذا wait() & notify() موجوده في الكلاس Object وليس في الكلاس Thread !
ابو الفؤاد
إقتباس
برأيكم لماذا Hashtable وليس HashTable ??

فعلا لاحظتها حتى في لغة C#
لكن لماذا ؟؟

إقتباس
لماذا wait() & notify() موجوده في الكلاس Object وليس في الكلاس Thread !

لان الـ Thread لا يستطيع ان يوقف نفسه او يعيد تشغيل نفسه !
Eisa Ayed
لان الـ Thread لا يستطيع ان يوقف نفسه او يعيد تشغيل نفسه !

اذاً لماذا start & sleep في Thread class ??
ابو الفؤاد
إقتباس
اذاً لماذا start & sleep في Thread class ??

عندما يستدعي الميثود Sleep فالمسئولية الان تقع على JVM لحساب الوقت الذي حدده الثريد عند انتهاء هذا الوقت يقوم JVM باعادة تفعيل الثريد

لكن اذا الثريد استدعى الميثود wait لا يمكن اخراجه من حالة الـ Blocking ألا باستدعاء الميثود notify والذي يكون من كلاس شغال
Eisa Ayed
جميل كلامك ،

ولكن الفكره هي بالفرق بين sleep & wait
Eisa Ayed
كيف تكون الجافا OO ، وهي تحتوي على int ,char , ??

ابو الفؤاد شغل مخي بشي غريب شفته blink.gif
ابو الفؤاد
إقتباس
ولكن الفكره هي بالفرق بين sleep & wait

يمكن انا مش عارف اوضح

وضح الفرق اخي عيسى ..!
Eisa Ayed
الفرق أن :

wait تعمل realease للlocks
sleep not realease
Eisa Ayed
اخواني ، ابو الفؤاد ،

دام اننا نتقابل بشكل دوري هنا ، وش رايك نحل اسئلة للمقابله الشخصيه الخاصه بالجافا ؟

مع الوقت راح نكتسب خبره في اشياء كثيره كنا نجهلها

اتمنى ان تطرحون اسئله مثل 114 سؤال
Eisa Ayed
مالفرق بين agruments , variables
هذه "نسخة - خفيفة" من محتويات الرئيسية للإستعراض الكامل مع المزيد من الصور والخيارات الرجاء إضغط هنا.
Invision Power Board © 2001-2009 Invision Power Services, Inc.