answersLogoWhite

0

📱

Java Programming

The Java programming language was released in 1995 as a core component of the Java platform of Sun Microsystems. It is a general-purpose, class-based, object-oriented language that is widely used in application software and web applications.

5,203 Questions

Why the pycnometer method more accurate than the hydrometer method?

The pycnometer method is more accurate than the hydrometer method because it uses an analytical balance.

Is there a Pa Inheritance tax If so how much is it?

Pennsylvania is one of the Seven states who impose an inheritance tax on the property and belongings acquired. The tax rate varies from class to class. Class A benificiaries are to pay 4.5%, while Class A1 are subject to 12% and Class B to 15%.

What is the difference between the muffin method and the biscuit method?

in the muffin method you include the fat with the liquids , in the biscuit method you cut the fat (cold) into the dry ingredients. Also, in the biscuit method, you have to knead the dough, roll it and cut it

What are the different java technologies?

There are several types of Java technology. Some examples of Java software are Java ME, Java EE, Java SE, and Java Card. Java made the JAVA development kit for those that develop in Java. There is also Java Virtual machine and some class libraries. Java is also famous for its languages like Clojure, Beanshell, Groovy, Gosu, Rhino, Kotlin, JRuby, Scala, and Jython.

What will heppen if an image drawn out of the window coordinate in Java?

ACM Java graphics programs run in a window called the graphics window. If the location is outside of the graphics window then the object is not visible.

What is the difference between conditional statements and looping statements?

The main difference is how often they run.

A conditional statement - often an IF - may or may not run. If it does (depending on whether a condition is fulfilled), it runs only once.

A looping statement - often a WHILE or FOR - is designed to repeat, while a certain condition is true.

What is RPC and RMI Give appropriates examples?

Remote Procedure Call (RPC) is a powerful technique for constructing distributed client-server based applications. RPC is a client /server infrastructure that increases the interoperability, portability and flexibility of an application by allowing the application to be distributed over multiple heterogeneous platforms. An RPC is analogous to function call. = How RPC Works = An RPC is analogous to a function call. Like a function call, when an RPC is made, the calling arguments are passed to the remote procedure and the caller waits for a response to be returned from the remote procedure. Figure 32.1 shows the flow of activity that takes place during an RPC call between two networked systems. The client makes a procedure call that sends a request to the server and waits. The thread is blocked from processing until either a reply is received, or it times out. When the request arrives, the server calls a dispatch routine that performs the requested service, and sends the reply to the client. After the RPC call is completed, the client program continues. RPC specifically supports network applications. Fig. 32.1 Remote Procedure Calling Mechanism A remote procedure is uniquely identified by the triple: (program number, version number, procedure number) The program number identifies a group of related remote procedures, each of which has a unique procedure number. A program may consist of one or more versions. Each version consists of a collection of procedures which are available to be called remotely. Version numbers enable multiple versions of an RPC protocol to be available simultaneously. Each version contains a a number of procedures that can be called remotely. Each procedure has a procedure number. = RPC Application Development = Consider an example: A client/server lookup in a personal database on a remote machine. Assuming that we cannot access the database from the local machine (via NFS). We use UNIX to run a remote shell and execute the command this way. There are some problems with this method: * the command may be slow to execute. * You require an login account on the remote machine. The RPC alternative is to * establish an server on the remote machine that can repond to queries. * Retrieve information by calling a query which will be quicker than previous approach. To develop an RPC application the following steps are needed: * Specify the protocol for client server communication * Develop the client program * Develop the server program The programs will be compiled seperately. The communication protocol is achieved by generated stubs and these stubs and rpc (and other libraries) will need to be linked in. Reomote Procedure Calling Mechanism A remote procedure is uniquely identified by the triple: ( program number, version number, procedure number). ADVANTAGES: Many distributed systems use Remote Procedure Calls(RPCs) as their main communication mechanism. RMI is a Remote method invocation

- RMI (Remote Method Invocation) is a way that a programmer, using the Java programming language and development environment, can write object-oriented programming in which objects on different computers can interact in a distributed network. RMI is the Java version of what is generally known as a remote procedure call (RPC), but with the ability to pass one or more objects along with the request. The object can include information that will change the service that is performed in the remote computer. Sun Microsystems, the inventors of Java, calls this "moving behavior." For example, when a user at a remote computer fills out an expense account, the Java program interacting with the user could communicate, using RMI, with a Java program in another computer that always had the latest policy about expense reporting. In reply, that program would send back an object and associated method information that would enable the remote computer program to screen the user's expense account data in a way that was consistent with the latest policy. The user and the company both would save time by catching mistakes early. Whenever the company policy changed, it would require a change to a program in only one computer. Sun calls its object parameter-passing mechanism object serialization. An RMI request is a request to invoke the method of a remote object. The request has the same syntax as a request to invoke an object method in the same (local) computer. In general, RMI is designed to preserve the object model and its advantages across a network. RMI is implemented as three layers: * A stub program in the client side of the client/server relationship, and a corresponding skeleton at the server end. The stub appears to the calling program to be the program being called for a service. (Sun uses the term proxy as a synonym for stub.) * A Remote Reference Layer that can behave differently depending on the parameters passed by the calling program. For example, this layer can determine whether the request is to call a single remote service or multiple remote programs as in a multicast. * A Transport Connection Layer, which sets up and manages the request. A single request travels down through the layers on one computer and up through the layers at the other end.

What are the differences between java and JavaScript?

There's a world of difference between the two. Javascript is used for front-end web development while Java can only be used as a back-end language within a web environment. Java doesn't need a web browser to compile and execute like Javascript does. Java is compiled prior to runtime while Javascript is compiled at runtime. The syntax/reserved-words are also different. There's many more differences if you go and do some research on the two languages.


Following are some points which differentiates java & javascript

  1. Java follows strong type checking where as Javascript is very flexible in datatype(loosly typed). Supports types which represents boolean,int,string
    • Ex : Variables in Java is declared as datatype ; --> int num;

    • But in Javascript variable declaration will be as var ; --> var myName;

  2. Javascript support function declarations, but without accessibility specifiers,parameter datatype,return type
  • Javascript : function fcnName(str)

{
........function body..........
}

  • Java : public int functionName(int no)

{
..........function body.........
}




will continue with answer...........
Java is a programming language designed to run in a Java Virtual Machine which is itself a program that allows java programs to run on any computer/device a Java Virtual Machine has been programmed for.

Java script is a scripting language that runs inside of a internet browser to enhance the web experience. Java script is designed to expand the capabilities of a web page so that it behaves more like a program on the computer than just a static page of text and images.

Sketch all binary tree with six pendent vertices?

The weights are tabulated in table given below.

V1V2V3V4V5V6V1-1016111017V210-9.5InfInf19.5V3169.5-7Inf12V411Inf7-87V510InfInf8-9V61719.51279-

What is the difference between GCC compiler and turbo c compiler?

1. The Gcc compiler cna support multiple languages such as c,c++,Java,Fortran,Pascal etc....

Whereas in turbo c cpmpiler,it doesn't support multiple languages.

2. GCC compiler is a free software,...

Whereas in turbo c cpmpiler , it is not a free software.

3. The GCC compiler is is a portable compiler,it runs on most plateform avilable today...

Whereas in turbo c cpmpiler, it is not a portable compiler.

How do you set button size in GridLayout java?

You don't. GridLayout is one of the layout managers that completely ignores all .setSize and .setPreferredSize method calls.

If you want to set the size of buttons in a GridLayout, you should add each button to a JPanel, and add the JPanels to the Container with a GridLayout. This way you can use, for example, a FlowLayout on the JPanel and use a button.setPreferredSize method call to try to keep the buttons a particular size.

What is the default value of the array elements in an integer array?

'0'

Try this:

public static void main(String[] args){

}

The output would be 0 even though you did not initialize any value in the int array.

What is the ER diagram on water bill system?

ER means that Entity relationship diagram that shows about system interaction on water and sewerage system development.Which is used fast and suficent water bill distribution for customers .

What does 'the programming series of classes does not comply with the Carnegie system of credit measurement' mean?

The Carnegie system awards 1 credit per 50 or 55 minute class session per week over the course of a semester. I assume the statement means there is more (or less) class time required for the programming courses. It may be that the courses are "stacked" or offered in another alternative delivery format. To be sure, ask the program representative.

What is the difference between Jar and Ear and War files?

JAR files (Java ARchive) allows aggregating many files into one, it is usually used to hold Java classes in a library. i.e. Math.jar

WAR files (Web Application aRchive) stores XML, java classes, and JavaServer pages for Web Application purposes.

EAR files (Enterprise ARchive) combines JAR and WAR files to make a combined archive for Enterprise Applications.

What is Zeisel's method?

Zeisel's method is used to estimate the alkoxy linkages in an organic compound. In this method the organic compound containing alkoxy group is treated with hydrogen iodide and the alkyl halide formed is further treated with silver nitrate to precipitate silver iodide

In this reaction only hydrogen iodide can be used because it consists of an ionic bond, while HF, HCl, HBr contain covalent bond where an iodide ion is liberated which forms a precipitate with silver nitrate. The silver iodide can be weighed and from its weight the number or alkoxy group can be estimated.

Write a function in java that accepts an array of integers and returns the second largest integer in the array Return -1 if there is no second largest?

Method 1:

Sort the array in descending order, compare 1st and 2nd if not same , return 2nd if same return -1

Method 2:

Find the largest number in the array, initialize another array with dimension 1 less than of original. Copy the array elements from the original array minus the largest element. not select largest from the second array and compare with the previous one if not same return the second largest if same return -1

Write a srs for restaurant billing system?

Software

Requirements Specification for library management system Page 9

switching between interfaces with the minimum impact for theusers.

4.

Risks

To reduce the circumstances under which this requirement mightnot able to be satisfied, all the designers must have beendeveloped web sites previously and they must be aware of htmlrestriction and cross browsers implementations before starting thedesigning. In order to reduce the probability of this occurrence theentire design team will be trained in basic html development andmacromedia fireworks, this tool will be used instead of Photoshop.

5.

Dependencies with other requirements

All user interfaces should be able to interact with the usermanagement module and a part of the interface must bededicated to the login/logout module

4.Non Functional Requirements

4.1. User Interfaces

4.2

. Hardware Interfaces

Server Side:

Software

Requirements Specification for library management system Page 10

Operating System: Windows 9x/xp ,Windows ME

Processor: Pentium 3.0 GHz or higher

RAM: 256 Mb or more

Hard Drive: 10 GB or more

Client side:

Operating System: Windows 9x or above, MAC or UNIX.

Processor: Pentium III or 2.0 GHz or higher.

RAM: 256 Mb or more

4.3

. Software Interfaces

Database:

SQL Server.

Application:

ASP (Active Server Pages)

Web Server:

IIS (Internet Information Services (IIS) is a powerfulWeb server that provides a highly reliable, manageable, and scalableWeb application infrastructure)

4.4. Communications Interfaces

The Customer must connect to the Internet to access the Website:

Dialup Modem of 52 kbps

Broadband Internet

Dialup or Broadband Connection with a Internet Provider.

5.Other Nonfunctional Requirements

Software

Requirements Specification for library management system Page 11

5.1

Performance Requirements

The proposed system that we are going to develop will be used as the Chief performance system within the different campuses of the university

whichinteract with the university staff and students. Therefore, it is expected thatthe database would perform functionally all the requirements that arespecified by the university.

5.2Safety Requirements

The database may get crashed at any certain time due to virus or operatingsystem failure. Therefore, it is required to take the database backup

5.3Security Requirements

We are going to develop a secured database for the university .There aredifferent categories of users namely teaching staff,administrator,library staff ,students etc.,Depending upon the category of user the access rights aredecided.It means if the user is an administrator then he can be able to modifythe data,delete,append etc.,All other users other than library staff only havethe rights to retrieve the information about database.

Software Quality Attributes

The Quality of the database is maintained in such a way so that it can be veryuser friendly to all the users of the database

5.4Hardware Constraints

The system requires a database in order to store persistent data. Thedatabase should have backup capabilities.

5.5 Software Constraints

The development of the system will be constrained by the availabilityof required software such as web servers, database and developmenttools. The availability of these tools will be governed bythe University of Ballarat. The most recent versions of software development tools may not beinstalled at the University of Ballarat.

Software

Requirements Specification for library management system Page 12

5.6Design Constraints

The system must be designed to allow web usability. That is, thesystem mustbe designed in such a way that will be easy to use and visible on mostof the browsers.

What is a Class 3 Public Primary Certification Authority?

Cross-Certificates Overview

A cross-certificate is a certificate issued by one Certificate Authority (CA) that signs the public key for the root certificate of another Certificate Authority. Cross-certificates provide a means to create a chain of trust from a single, trusted, root CA to multiple other CAs.

When will compilation error occur?

Syntax errors are typically picked up at design time by the code editor. If the programmer is no using a code editor (he is using notepad, for instance), syntax errors become compile time errors.

In java what is empty statement.Explain its usefulness?

An empty statement in Java is just that: a statement with nothing in it. There are typically two ways to represent this:

  1. A single semicolon ;
  2. An empty block {}
The usefulness of this type of statement is limited. The main use that I can think of is to fulfill the statement required for a loop structure.

Here is an example that I recently used:

while (sf(++n) != i);

This loop will constantly call the method sf with increasing values of n until the return value of sf(n) is equal to i. Each loop in Java must have some code to execute in the loop body. In this case, all necessary work is done in the condition, and so the mandatory loop body is an empty statement.

While there may be other (more clear) ways of writing this bit of code, this is an example of where that empty statement can be used.