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

What is the difference between Malloc and calloc in C and JAVA?

In C, malloc is used to reserve a predetermined size of memory.

void * malloc ( size_t size );

calloc is used to reserve a chunk of memory large enough to store num elements, each of a predetermined size.

void * calloc ( size_t num, size_t size );

To create a char array of size 10 you can do it in one of two ways:

char* mChars = malloc( 10 * sizeof(char) );

char* cChars = calloc( 10, sizeof(char) );

There is no concept of malloc or calloc in Java.

How do you call a function named my function?

In most languages, you can't have names with space, for functions, variables, etc. Assuming your function is called myFunction, the usual way to call it is:

myFunction()

This assumes the function requires no parameters. If the function does require parameters, the parameters will be included within parentheses.

What are impure functions in Java?

Pure functions are those which do not modify the state of an object. Most often these are functions which take arguments and return a result.

Can you install java application on nokia n95?

Most mobile devices do not have the capability of handling the Java program.

What is the purpose of template functions?

Template functions provide the ability to write a single function that can accept different types of inputs and produce different types of output, while still using the same logic. For example, a template function can accept an int, long, or float and perform the same logic on any of the three types of parameters. The compiler ensures that the template function will make sense when compiled with a particular type. This was an early attempt at polymorphism (using the same code on different types of objects), and has since been superseded in newer languages using objects and inheritance.

Difference between Object Oriented Analysis and Object Oriented Design?

Structured Analysis treats processes and data as separate components versus object-oriented analysis combines data and the process that act on the data into objects. http://www.dbar-innovations.com

What is a default value?

A default value is the one that has been considered the most appropriate on several

systems, methods, programs. Obviously it is the parameter which works better, otherwise it wouldn't be set as a standard value. To set something "by default" is the same as to choose a value, a configuration more convenient for that purpose.

How do you download c plus plus on vista?

You cannot download a programming language, but you can download compilers. Check the attached link.

Why polygon method called as graphical method?

The polygon method is referred to as a graphical method because it visually represents data and relationships through geometric shapes, typically polygons. In this approach, data points are plotted on a graph, and lines or curves connect them to form a polygon, allowing for easier interpretation of trends, patterns, and correlations. This visual representation helps in analyzing complex data sets intuitively, making it accessible for decision-making and comparisons.

Is java needed to surf the web?

Java is not a necessity but there are some websites that will not work properly without it installed and activated. Java needs to be updated often or errors on certain pages will occur. Gaming sites require that it be installed and activated or the games will not operate.

Addition of two numbers without using operators in java?

I don't think this can be done. Why do you want to do it without operators, anyway? It is fairly simple to use them. - Of course, you could write a method that adds two numbers, but your method will internally still have to use operators.

-----------------------------------------

Reply by lordstriker24@yahoo.com

import java.math.BigInteger;

public class MultiplyTest {

public static void main(String[] args) {

BigInteger bigInt1 = new BigInteger("5");

BigInteger bigInt2 = new BigInteger("8");

System.out.println(bigInt1.add(bigInt2));

}

}

When the object is created?

The computer desktop encyclopedia says

In object technology, to create an object of a specific class

(1) A single copy of a running program. Multiple instances of a program mean that the program has been loaded into memory several times. (2) In object technology, a member of a class; for example, "Lassie" is an instance of the class "dog." When an instance is created, the initial values of its instance variables are assigned.

Why does Java support multilevel inheritance?

Because it is one of the most important and widely used inheritance concepts in Java. In multi level inheritance a class directly inherits features from one class and indirectly inherits features form other classes that are in the inheritance hierarchy.

How i can learn Java fast?

Java will take some time to learn. If you spend several hours a day you can learn the basics in a few weeks and do some "hello word" type programs.

If you're looking for more immediate results from a programming language you can look at Python or PHP.

What is the difference between languages used in artificial intelligence and other programming languages?

If you're talking about "traditional" AI programming languages like LISP and Prolog, the essential difference boils down to the language's ruling metaphor.

Most standard programming languages operate on a principle of sequential and/or branching instruction execution.

OTOH, the LISt Processing language (LIST) encourages its programmers to view everything (all solutions to programming problems) in the form of one or many lists.

Prolog is perhaps the furthest evolution to date away from the standard, sequential-instruction programming model: in Prolog, the programmer does not explicitly spell out the sequence of operations (a.k.a., "procedure," hence "procedural languages") needed to solve a problem; instead, the problem is simply declared (hence, "declarative language"), and the language itself (or rather the engine implementing it) seeks out the solution.

Nowadays, though, you'll find AI being implemented in any number of standard procedural languages -- C++, Java, even scripting languages like Perl and Python.

Can an abstract method be declared static in java?

No you cant, any compiler I've ever used wont allow this. It would not make any sense to do this anyway.

because the JVM directly accesses ur top class without instantiating it. Though for accessing the instance data members, the class must need to be instantiated.

How do you convert an integer to a string?

That really depends on the programming language. In Java, it is sufficient to concatenate it with a String:

int myNumber = 5;

result = "" + myNumber;

Other languages may require a special function, or method, to convert from integer to string.

Is it possible to run java program without JVM?

No. Java programs run in the Java Virtual Machine (JVM) - without it your computer won't know how to handle Java bytecode.

When to use a non-abstract method in an abstract class?

In an abstract class some methods could be abstract meaning a sub-class must provide the actual implementation code or non-abstract in those cases the functionality is common to all or most of the sub-classes. With respect to the non-abstract classes, some sub-classes could override those as needed unless they're defined final.

Example of such classes found in the core J2SE API include:

java.awt.Component, java.awt.geom.Point2D, java.io.InputStream, java.io.Reader, java.util.AbstractCollection, and many others.

Take java.util.AbstractCollection as a typical example. It provides placeholders for abstract methods iterator() and size(), and provides the concrete methods clear(), contains(), isEmpty(), etc. which use the former abstract methods to perform a generic function as defined in the specific implementation of a sub-class. The abstract class defers the details of the specific implementation to its sub-classes. The class java.util.HashSet extends AbstractCollection and defines the non-abstract implementation code for both iterator() and size() methods.

Does the Currency data type means field can only contain text and monetary data?

That will vary on the programming language used, but in general, it is a data type with a fixed number of decimal digits - usually four - which internally stores the number it represented as a whole number - for four digits, that would mean multiplying it by 10,000. It is commonly used to store currency values, but it can also be used for other type of data, when you are sure you won't need more than four decimals; its benefit is that additions and subtractions with this data type are exact - they don't suffer from rounding errors that appear when converting between decimal and binary, with other data types.