الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

أسئلة في الجافا

مغلقاستطلاعرائج
بدأه iyadhoo في 27 نوفمبر 2006 · 54 رد · 17,845 مشاهدة · في منتدى الشهادات
مشاركة: واتساب X فيسبوك تيليجرام
#26

أنا أعتذر على عدم مواصلتي لأنني مركز على java 2D

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

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

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

#27

أسئلة ماهي المخرجات وأين الخطأ .. عندي عقدة منها :) .. ولكن هي أسئلة بسيطة .

--

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

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

لكن لا اعلم .. هل ارفعها او لا .. يعني هل نعطي واجبات محلولة .. أو هذا مو من صالح الطلاب ,,

logo1.png تطبيق طمأنينة ، نسخة بيتا على أندرويد

عبدالله الشمّري - Al-Shammari

CodingAlone.com

twitter @abshammeri

abshammeri AT gmail.com

github : abshammeri

#28

أهلا أخي الشمري..

بصراحة كان هدفي من هذا الموضوع -بعد مبادرة مشرفتنا nardien- هو تكوين "بنك أسئلة" متنوعة تشمل أساسيات جافا أو مستويات متقدمة منها.. بحيث يستفيد منها كل الأعضاء وتكون مرجع لمن يريد التقدم لامتحانات في جافا سواء في الجامعة أو scjp .. وأيضاً يكون هناك شيء من التفاعل في هذا المنتدى النائم !!..

لكن إلى الآن لم يهتم أحد من المشرفين لترتيب الأسئلة..!!

فحنوت ألثم جرحه الرعافَ فانتكأت جراحي..

وهمت على خدي الدموع فقلت يا روحي وراحي..

هلّا رحمتَ قلوبنا .. وعدلت عن هذا الرّواحِ ِ ..؟

فأجابني البطل المسجّى هازئاً بيَ .. باقتراحي

كفكف دموعك ليس في عبراتك الحرّى ارتياحي

هذي سبيلي .. إن صدقت محبتي .. فاحمل سلاحي

Sun Certified Java Programmer

#29
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 ؟

الشمري اذا كانت اسئلتك فيها تفكير ومعقده اطرحها بغض النظر وجود حلول أو لا

#30
اقتباس
لكن إلى الآن لم يهتم أحد من المشرفين لترتيب الأسئلة..!!

هأرتبهم يا اياد .. بس صبرك عليا ..

لما تخلص الامتحانات هشوفلهم حل

المهم لا تعصب ... وشكرا لإياد وعيسى لمشاركتهم الدائمة في هذا الموضوع

سيمضي ركبنا العملاق لن يركع .. بإيمان لغير الحق لا يصدع

عزيزا شامخا كالمجد بل أروع .. فسجل أيها التاريخ ما تسمع :

فلسطين لنا الآمال والمطمع .. نعاهد أن نحررها وأن ترجع

ونقسم نستعيد الأرض أو نصرع .. ويبقى رمزنا الزيتون والمدفع

Palestine.gif

#31
اقتباس
هأرتبهم يا اياد .. بس صبرك عليا ..

لما تخلص الامتحانات هشوفلهم حل

المهم لا تعصب ...

ماشي ... ماني معصب أبداً angry: :angry: :angry:...........

:lol:

المهم تمضى الامتحانات على خير .. بالتوفيق إن شاء الله للجميع ..

على كل سأقوم بترتيب الأسئلة في ملفات pdf وسأضع كل 50 سؤال معاً مع أجوبتها وأرفعها في القريب بإذن الله.

أخ عيسى أهلا وسهلا بعد طول غياب !!

السؤال الأول 4

السؤال الثاني ..ممممم قد يكون 2

Lil له محدد الوصول default ..

والله أعلم!

:)

تم تعديل هذه المشاركة بواسطة iyadhoo في 29 ديسمبر 2006 في 01:08

فحنوت ألثم جرحه الرعافَ فانتكأت جراحي..

وهمت على خدي الدموع فقلت يا روحي وراحي..

هلّا رحمتَ قلوبنا .. وعدلت عن هذا الرّواحِ ِ ..؟

فأجابني البطل المسجّى هازئاً بيَ .. باقتراحي

كفكف دموعك ليس في عبراتك الحرّى ارتياحي

هذي سبيلي .. إن صدقت محبتي .. فاحمل سلاحي

Sun Certified Java Programmer

#32

السؤال الثاني خطأ ،

تابع معي Thread Life Cycle :

thread_life_cycle.jpg

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

java.lang.IllegalMonitorStateException

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

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

قبل Thread1.start()

سيظهر الخطأ java.lang.IllegalMonitorStateException

#33
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 ?
#34

الله يجزيك الخير أخ عيسى بصراحة الأسئلة جميلة جداً .. وعلينا التعاون في الإجابة عليها ..

لكن ... بعد الامتحانات

فحنوت ألثم جرحه الرعافَ فانتكأت جراحي..

وهمت على خدي الدموع فقلت يا روحي وراحي..

هلّا رحمتَ قلوبنا .. وعدلت عن هذا الرّواحِ ِ ..؟

فأجابني البطل المسجّى هازئاً بيَ .. باقتراحي

كفكف دموعك ليس في عبراتك الحرّى ارتياحي

هذي سبيلي .. إن صدقت محبتي .. فاحمل سلاحي

Sun Certified Java Programmer

#35

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) );
}

مستوى الأسئلة : مبتدء إلى متوسط .

ENG-GAZA.GIF
#36

سؤالك الاول تتبعته إلى هذا الحد وطلعت بالتالي ((^/^)/(^/^

لو كانت لدي ورقه وقلم لأكملت ولكن بدون ورقه ضعت في نهايته

#37

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

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

#38

السلام عليكم

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

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 ?

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

لكن دعونا نرى ماهي

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

أتمنى ان تكون اجاباتي شافيه وأرحب بأي ملاحظه او تصحيح أو إثراء للمعلومات وحتى لو كانت بسيطه أو نقاش أو اي شي بس خلونا نتناقش :(

#39

up up up

#40

خلال شهر كامل لم يتم مناقشة اي موضوع

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

#41

برأيكم لماذا Hashtable وليس HashTable ??

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

#42
اقتباس
برأيكم لماذا Hashtable وليس HashTable ??

فعلا لاحظتها حتى في لغة C#

لكن لماذا ؟؟

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

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

منقطع من حين لاخر

#43

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

اذاً لماذا start & sleep في Thread class ??

#44
اقتباس
اذاً لماذا start & sleep في Thread class ??

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

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

منقطع من حين لاخر

#45

جميل كلامك ،

ولكن الفكره هي بالفرق بين sleep & wait

#46

كيف تكون الجافا OO ، وهي تحتوي على int ,char , ??

ابو الفؤاد شغل مخي بشي غريب شفته :blink:

#47
اقتباس
ولكن الفكره هي بالفرق بين sleep & wait

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

وضح الفرق اخي عيسى ..!

منقطع من حين لاخر

#48

الفرق أن :

wait تعمل realease للlocks

sleep not realease

#49

اخواني ، ابو الفؤاد ،

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

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

اتمنى ان تطرحون اسئله مثل 114 سؤال

#50

مالفرق بين agruments , variables

هذا الموضوع مغلق.

مواضيع مشابهة