How objects are created in Java internally?

Ans: When the Java Virtual Machine (JVM) initially starts the process of running a java program, it allocates a portion of memory to be used as Heap (you can actually specify the Heap size on the command line when you run the program). While the JVM is running the program, whenever a new object is created, the JVM reserves as portion of the Heap for that object (where the object will be stored). The amount of Heap that gets reserved is based on the size of the object. The JVM maps out this segment in the Heap to represent all of the attributes...

What are the various ways to create an object in Java?

Ans: 1. Using new keyword This is the most common way to create an object in java.In This we will be using the new operator which will allocates the memory space and initialize the field with default value. Then it executes the code inside the specified constructor which normally re-writes the default values with the value inside the constructor. 1 MyObject object new MyObject();  2. Using Class.forName() If we know the name of the class & if it has a public default constructor we can create an object in this way. 1 MyObject...

What is the difference between concat and append?

Ans: 1. Concat is used to add a String at the end of another String. Append adds a String          or character sequence to StringBufffer. 2. Concat creates a new String object, whereas StringBuffer append doesn't. 3. Append is more efficient than conca...

In which situation Arrays and ArrarList should be used?

Arrays are the most commonly used data structure to store a collection of elements. Most programming languages provide methods to easily declare arrays and access elements in the arrays. An arraylist can be seen as a dynamic array, which can grow in size. Due to this reason, the programmer does not need to know the size of the arraylist when she is defining it. What are Arrays? Shown in figure 1, is a piece of code typically used to declare and assign values to an array. Figure 2 depicts how an array would look like in the memory. int values[5]; values[0]=100; values[1]=101; values[2]=102; values[3]=103; values[4]=104; ...

etol() and ltoe()

Syntax long etol( domain domain_value ) Description This returns the numeric code corresponding to a specified value in an enumerated domain.  Syntax domain ltoe( long long_value ) Description This returns the named constant corresponding to a specified numeric code. The numeric code represents one of the values in an enumerated domain.  Example This example assumes an enumerated domain 'yesno'  with two possible constants: 'yesno.yes’ (=1) and 'yesno.no’ (=2). domain    yesno active long      enum_long active...

enum.descr$()

Syntax string enum.descr$(string domain code(12), enum_expr [, string language_code ] ) DescriptionThis returns the description associated with a specific value in an enumerated domain.  Argumentscode:The name of the domain. The domain must be of type enumerated.enum_expr:One of the possible values of the enumerated domain.language_code:To retrieve the description in a language other than the user language, specify the relevant language code in this argument. This is an optional argument. The default language is the language of the user.Note...

ask.enum()

Syntax domain ask.enum( string quescode(10), domain default_enumval [, arg ] ... ) Description This displays a message box containing a question and a number of possible responses. The responses are presented as push buttons. To respond to the question and close the message box, the user selects one of the push buttons. The possible responses are defined in the data dictionary as an enumerated domain. By default, the function displays all of the defined enumerate values. To display a subset only, call set.enum.values() before calling ask.enum(). Arguments quescode:The...

Enumerate and Set constant

In the data dictionary you can define database table fields and domains of type enumerate or set. An enumerate or set domain consists of a number of constants. In the program script (and other places in the data dictionary), a symbolic name is used. The symbolic name is the domain name, followed by a period [.] followed by the name of the constant. Variables of type set can also consist of a combination of set values. Examples of enumerate constants DOMAIN color box_color                 | color is...

Google: Fixes security patch in wallet service

 Google assured users of its smartphone wallets that the mobile-age technology thwarts thieves better than old-school cash or credit cards.A Google Wallet feature that lets people load prepaid card information in smartphones for spending was re-activated this week after being shut off for a few days to fix a potential security vulnerability. The action from Google came after a Zvelo Labs researcher demonstrated software that quickly figures out a Wallet personal identification number (PIN),...

StumbleUpon tweaks its new redesign

Now StumbleUpon redesign by removing the red"X" from its toolbar.Actually many people suggested that the removal of the close button locked you into staying on StumbleUpon and cried foul since you could no longer go directly to the original content creator’s page. StumbleUpon wanted to give a quick update on concerns over the implementation of new WebStumbleBar,said Garrett Camp CEO and Co-Founder of StumbleUpon. StumbleBar previous design included an ‘X’ button but now its not initially...

Runtime Data Dictionary

The tools environment consists of two major components, namely the application data dictionary and the runtime data dictionary. A data dictionary is, basically, a collection of software components and data definitions. Together, these software components and data definitions form the BAAN IV application.In the application data dictionary, only the definitions and the descriptions of how the entire BAAN IV application is built are stored. To be able to work with this software, there must first be...

Messages

1) Explanation of messagesMessages are language-dependent software components and are, therefore, maintained by language. The message code, however, is the same for all languages. Messages are used in program scripts and functions, and are linked to domains, tables, table fields, and form fields.When scripts or functions are being programmed, it is possible to include messages. Consequently, once the scripts are compiled and the objects are executed, the matching messages can be displayed. 1.1) Message...

Labels

1) Explanation of labels Labels are generic pieces of text that are stored by language in a central label file. Because of the use of labels for every text element in menus, forms, and reports, the layouts of these software components become language-independent. As a result, menu, form, and report layouts do not need to be stored and maintained for each language separately.Also, all prompts and other text elements are maintained and translated in a central label file so as to be able to use and...

What is the difference between final, finally and finialize?

final can be used to mark a variable "unchangeable" private final String name = "foo";  //the reference name can never change  final can also make a method not "overrideable" public final String toString() {  return "NULL"; }  finally is used in a try/catch statement to execute code "always" lock.lock(); try {   //do stuff } catch (SomeException se) {   //handle se } finally {   lock.unlock(); //always executed, even if Exception or Error or se }  finalize is called when...

Apple's 8-inch tablet is tested

Apple is testing a tablet computer with a smaller screen than the hot-selling iPad.The iPad has a 9.7-inch (24.6-cm) screen. Apple has sold more than 55 million iPads since launching the device in April 2010.Apple was working with Taiwan's AU Optronics Co and South Korea's LG Display Co to supply the test panels.Apple frequently works with suppliers to test new designs and "could opt not to proceed with the device.Apple's iPad 3" will have a higher resolution screen than the iPad 2 but will...

Obama:stop outsourcing from chindia

President Barack Obama has said that he does not want US companies to look for skilled and educated workers from India and China in fields of engineering , technology and science. Organizations today are looking for astute people and they hire from india and china and i don't want this thing. I want to give resources to train people of USA.The President said he wants the Congress to give the schools the resources to keep good teachers on the job and reward the best. "In return , they also need...

Sessions

1) Explanation of sessions If sessions in BAAN IV are compared with a program in a 3GL programming language such as BASIC or PASCAL, sessions can be seen as the programs that are needed to run parts of the BAAN IV application. Physically, a session is an executable combination of forms, reports, charts, a main table, and a program script. Furthermore, sessions are used to form the link between these software components. TablesEvery session involves the manipulation of data in one or more tables....

Master Data

1)Master Data for customization and development 1.1) Interface data When BAAN IV is installed, a default interface Master Data set is also installed. The interface data is laid down by Baan as the standard and is, therefore, not often changed. However, if changes are needed, it is advised to minimize these changes since they will directly affect the commands throughout BAAN IV as well as the appearance of BAAN IV itself. The interface Master Data makes it possible to control option groups, option descriptions, menu bar/toolbar data, buttons, status...

Microsoft's india store is hacked

Microsoft's online store in India was hit by hackers over the weekend and is currently offline.Visitors to microsoftstore.co.in are met with the following message: "The Microsoft Store India is currently unavailable. Microsoft is working to restore access as quickly as possible. We apologize for any inconvenience this may have caused."The hack, first reported by wpsauce.com and picked up by the Times of India, occurred last night. The website was replaced with an image of a hooded individual wearing...

Hotmail's anti spam action

Microsoft funded a study, testing the anti-spam skill of Hotmail, Gmail, and Yahoo Mail. Accounts were created, and ‘seeded’ across the Internet in an attempt to draw the bead of spammers. It worked. According to a New York Times article on the report, “in the Hotmail account, 48.57 percent of e-mails in the inbox were spam, slightly less than the 48.88 percent in the Gmail inbox. Yahoo Mail was third with 58.33 percent.” Now, any normal account on the three services would have a much lower ratio....

Super simple photo editing with enThread, right in your browser

enThread is a photo processing app, of sorts, that runs in your browser, features a drag & drop upload process and is probably powerful enough for the majority of your quick daily edits. enThread is a new project from Quinton Pike, a guy that you might recognize as the developer behind the music-streaming service Mougg. It seems that Pike went back to the drawing board with enThread, and produced something that I believe will be considerably more useful over time. To launch it, just go to the...

Finally Youtube and gmail are blocked in Iran

The situation is now official on Google’s side, as the company confirmed that several of its products have been blocked in the Iran.According to Google, Iranian users have been unable to access its encrypted search, YouTube and Gmail since February 10th. This could only be the tip of the iceberg, as several other sites have been reportedly inaccessible for the last days. Yet, the stranglehold that Iran has on the Internet isn’t new – up to the point where local authorities are mulling plans...

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More