प्रश्न और उत्तर का अभ्यास करें

प्र: What is the Set interface ? 1489 0

  • उत्तर देखेंउत्तर छिपाएं
  • Workspace

उत्तर :
व्याख्या :

- The Set interface provides methods for accessing the elements of a finite mathematical set - Sets do not allow duplicate elements - Contains no methods other than those inherited from Collection - It adds the restriction that duplicate elements are prohibited - Two Set objects are equal if they contain the same elements

प्र: What is the Dictionary class? 1038 0

  • उत्तर देखेंउत्तर छिपाएं
  • Workspace

उत्तर :
व्याख्या :

- The Dictionary class is an abstract class. - Classes like Hashtable which map keys to values inherit from this class.  - An object can be looked for if a dictionary and a key is provided. - Any non-null object can be used as a key and as a value.

प्र: What is the SimpleTimeZone class? 994 0

  • उत्तर देखेंउत्तर छिपाएं
  • Workspace

उत्तर :
व्याख्या :

SimpleTimeZone is a concrete subclass of TimeZone class. The TimeZone class represents a time zone, that is to be used with Gregorian calendar. The SimpleTimeZone is created by using the base time zone offset from GMT time zone ID and rules, for starting and ending the time of daylight.

प्र: What are Native methods in Java? 1735 0

  • उत्तर देखेंउत्तर छिपाएं
  • Workspace

उत्तर :
व्याख्या :

Java applications can call code written in C, C++, or assembler. This is sometimes done for performance and sometimes to access the underlying host operating system or GUI API using the JNI.   The steps for doing that are: First write the Java code and compile it Then create a C header file Create C stubs file Write the C code Create shared code library (or DLL) Run application

प्र: What is Auto boxing and unboxing? 2103 0

  • उत्तर देखेंउत्तर छिपाएं
  • Workspace

उत्तर :
व्याख्या :

Autoboxing is the process of converting a primitive type data into its corresponding wrapper class object instance. Example: Integer number = new Integer (100); // number is now refers to the object 100   Unboxing is the process of converting a wrapper instance into a primitive type. Example:  Integer number = new Integer (100);  int num = number;// without type casting number would be changed into int type

प्र: How does thread synchronization occurs inside a monitor? 1728 0

  • उत्तर देखेंउत्तर छिपाएं
  • Workspace

उत्तर :
व्याख्या :

A Monitor defines a lock and condition variables for managing concurrent access to shared data. The monitor uses the lock to ensure that only a single thread inactive in the monitor code at any time. A monitor allows only one thread to lock an object at once.

प्र: Why do we need wrapper classes in Java? 1843 0

  • उत्तर देखेंउत्तर छिपाएं
  • Workspace

उत्तर :
व्याख्या :

Dealing with primitives as objects is easier at times. Most of the objects collection store objects and not primitive types. Many utility methods are provided by wrapper classes. To get these advantages we need to use wrapper classes. As they are objects, they can be stored in any of the collection and pass this collection as parameters to the methods.   Features of the Java wrapper Classes: - Wrapper classes convert numeric strings into numeric values. - The way to store primitive data in an object. - The valueOf() method is available in all wrapper classes except Character - All wrapper classes have typeValue() method. This method returns the value of the object as its primitive type.

प्र: What is Shallow and deep cloning in Java? 1569 0

  • उत्तर देखेंउत्तर छिपाएं
  • Workspace

उत्तर :
व्याख्या :

Cloning refers to creating duplicate copies of objects in java. Shallow Cloning: Shallow cloning is a bitwise copy of an object. New object is created which is an exact copy that of the original one. In case any objects are referring the fields of these objects, just the references are copied. Deep Cloning: In deep cloning, complete duplicate copy of the original copy is created. Deep cloning creates not only the primitive values of the original objects but also copies all its sub objects as well. Clonable interface is used to perform cloning in java.

      त्रुटि की रिपोर्ट करें

    कृपया संदेश दर्ज करें
    त्रुटि रिपोर्ट सफलतापूर्वक जमा हुई

      त्रुटि की रिपोर्ट करें

    कृपया संदेश दर्ज करें
    त्रुटि रिपोर्ट सफलतापूर्वक जमा हुई

      त्रुटि की रिपोर्ट करें

    कृपया संदेश दर्ज करें
    त्रुटि रिपोर्ट सफलतापूर्वक जमा हुई

      त्रुटि की रिपोर्ट करें

    कृपया संदेश दर्ज करें
    त्रुटि रिपोर्ट सफलतापूर्वक जमा हुई

      त्रुटि की रिपोर्ट करें

    कृपया संदेश दर्ज करें
    त्रुटि रिपोर्ट सफलतापूर्वक जमा हुई

      त्रुटि की रिपोर्ट करें

    कृपया संदेश दर्ज करें
    त्रुटि रिपोर्ट सफलतापूर्वक जमा हुई

      त्रुटि की रिपोर्ट करें

    कृपया संदेश दर्ज करें
    त्रुटि रिपोर्ट सफलतापूर्वक जमा हुई

      त्रुटि की रिपोर्ट करें

    कृपया संदेश दर्ज करें
    त्रुटि रिपोर्ट सफलतापूर्वक जमा हुई