Discuss, Learn and be Happy דיון בשאלות

help brightness_4 brightness_7 format_textdirection_r_to_l format_textdirection_l_to_r

איזה מחלקה מרחיבה את InputStream?

1
done
Explanation: ObjectInputStream class extends the InputStream class and implements the ObjectInput interface.
by
מיין לפי

מהו הפלט של תוכנית זו?

1
done
Explanation: oos.writeInt(5); writes integer 5 in the Output stream which is extracted by z = ois.readInt(); and stored in z hence z contains 5.
by
מיין לפי
by Shay Giladi
Shay Giladi 8 נקודות · יותר מ-6 חודשים
מוניטין: 575
יש טעות בקוד, שומרים לתוך z אבל מדפיסים את x
by
by Yoad Ben David
Yoad Ben David 1 נקודות · יותר מ-6 חודשים
מוניטין: 25
תודה אח
by

מה הפלט של תוכנית זו?

1
done
Explanation: x = ois.readInt(); will try to read an integer value from the stream ‘serial’ created before, since stream contains an object of Myclass hence error will occur and it will be catched by catch printing deserialization.
by
מיין לפי
by Manuel Ruffieux
Manuel Ruffieux 0 נקודות · יותר מ-6 חודשים
מוניטין: 175
הסבר?
by
by Yuval Schwartz
Yuval Schwartz 0 נקודות · יותר מ-6 חודשים
מוניטין: 1
עזוב זה גם ככה לא יעזור לך..
by
by Guy Biton
Guy Biton 1 נקודות · יותר מ-6 חודשים
מוניטין: 24
ברגע שאתה תעשה readInt יקפוץ לך אקספשן כי כתבת אובייקט ואתה מנסה לקרוא int בגלל זה בcatch יש לך את ההדפסה של deserialization
by

מה הפלט של תוכנית זו?

1
done
Explanation: New input stream is linked to steal ‘serials’, an object ‘ois’ of ObjectInputStream is used to access this newly created stream, ois.close(); closes the stream hence we can’t access the stream and ois.available() returns 0.
by
מיין לפי
by Omer Laufer
Omer Laufer 0 נקודות · יותר מ-6 חודשים
מוניטין: 1
איך בדיוק זה אפס?
by
by Lior Linoi Aftabi
Lior Linoi Aftabi 1 נקודות · יותר מ-6 חודשים
מוניטין: 19
כי הוא סגר את OIS, מה שאומר שהוא יבדוק את מספר הבתים זה יהיה 0
by

מהו הפלט של תוכנית זו?

1
done
Explanation: oos.writeFloat(3.5); writes 3.5 in output stream. A new input stream is linked to stream ‘serials’, an object ‘ois’ of ObjectInputStream is used to access this newly created stream, ois.available() gives the total number of byte in the input stream since a float was written in the stream thus the stream contains 4 byte, hence 4 is returned and printed.
by
מיין לפי
by may levi
may levi 0 נקודות · יותר מ-6 חודשים
מוניטין: 1
אשמח להסבר
by
by Ido Kraicer
Ido Kraicer 0 נקודות · יותר מ-6 חודשים
מוניטין: 1
Float הוא פרימיטיבי בגודל 4 בתים, אז הכתיבה שלו היא 4 בתים
by

מה יודפס על הפלט ויכתב לקובץ, בתכנית הבאה?

1
done
Explanation: First, it will print “Success” and besides that it will write “Welcome to Sanfoundry” to the file sanfoundry.txt.
by
מיין לפי

באיזו שיטה ניתן להשתמש כדי להפוך את הTHREAD הראשי להתבצע אחרון בין כל הTHREADים?

1
done
Explanation: By calling sleep() within main(), with long enough delay to ensure that all child threads terminate prior to the main thread.
by
מיין לפי
by Shachar Adam
Shachar Adam 1 נקודות · יותר מ-6 חודשים
מוניטין: 131
זה לא yield?
by
by Nadav Cherry
Nadav Cherry 0 נקודות · יותר מ-6 חודשים
מוניטין: 10
למה זה לא JOIN?
by
by Netanel Krotovich
Netanel Krotovich 0 נקודות · יותר מ-6 חודשים
מוניטין: 1
Join רק גורם לתכנית שמריצה את הטרד לא להמשיך עד שמי שעשו עליו join סיים את הפעולה שלו, זה לא גורם לטרד לרוץ אחרון
by
by Yadin Deri
Yadin Deri 0 נקודות · יותר מ-6 חודשים
מוניטין: 17
By calling sleep() within main(), with long enough delay to ensure that all child threads terminate prior to the main thread
by

איזו שיטה משמשת כדי לגלות האם THREAD עדיין פועל או לא?

1
done
Explanation: The isAlive( ) method returns true if the thread upon which it is called is still running. It returns false otherwise.
by
מיין לפי

מהו ערך ברירת המחדל של המשתנה MIN_PRIORITY ו- MAX_PRIORITY?

1
done
by
מיין לפי

איזו שיטה מחכה שTHREAD יסיים?

1
done
by
מיין לפי