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

How to write daemons using threads instead of using fork as there are certain conditions in which a process is called a daemon?

A "daemon" is a general English term for a process that is meant to run forever in the background, without access to a display terminal. Threads are subcomponents of processes. It is not possible to run as an isolated "thread". Every process contains at least one thread, but can contain more if programmed correctly. Threaded programming typically is done so that a master or "manager" thread listens for an indication of incoming work to be done, and then dispatches this work to a new "worker" thread to handle the work, freeing the manager thread to listen for more incoming work.

Java run in any computer but java script not why?

Java and Javascript are not the same thing and are not realted to each other.

Javascript is not run on "computers" it is run on browsers (which admitedly run on computers)

So, if your computer has a browser, it most likely runs javascript, of course this depends on the browser, but all major browser run javascript.

Java program to display grade as per percentage of marks?

import java.util.Scanner;

import static java.lang.Syatem.out;

class Student

{

public static void main (String ar[])

{

Scanner sc = new Scanner (System.in);

System.out.println("Enter % of Student : ");

int G = sc.nextInt();

{

if(90=<G) && (G=<100)

System.out.println("Grsde is A+");

else

{

if(80=<G) && (G=<99)

System.out.println("Grsde is A");

else

{

if(70=<G) && (G=<89)

System.out.println("Grsde is B+");

else

{

if(60=<G) && (G=<79)

System.out.println("Grsde is B");

else

{

if(50=<G) && (G=<69)

System.out.println("Grsde is C+");

else

{

if(40=<G) && (G=<59)

System.out.println("Grsde is C");

else

{

if(34=<G) && (G=<39)

System.out.println("Grsde is D+");

else

{

if(G=33)

System.out.println("Grsde is D");

else

{

if(G<32)

System.out.println("Grsde is Fail");

else

System.out.println("Invalid Entry");

}

}

}

}

}

}

}

}

}

}

}

How do you fix java problem the system cannot find the path specified?

Make sure the environmental variables "classpath" and "path" are properly set. Also check if all requisite JARS are present in the projects build path.

In case you are getting this during File input/output - check if the file is present in the appropriate location.

List two methods for obtaining isolated colonies.?

Use a "streak plate" or a "spread plate". Mediums that allow some organisms to grow and not others can also be used. These types of mediums are called Selective medium.

Why must numeric values be assigned to variables when comparing results?

In order to compare any two values, both values must be stored somewhere otherwise it would be impossible for the machine to refer to those values let alone operate upon them. Typically we store variables in main memory, however values can also be stored directly in the machine's registers. These are known as register variables and the only practical difference between a register variable and an ordinary variable is that we cannot take the memory address of a register variable (because it has no address to take).

If we can take the address of a variable then that variable is said to have identity because it exists in memory and we can identify it solely by its address. When comparing values that have identity, we can either compare the values themselves or we can compare their identities. The latter helps us determine whether two values are the same variable or not.

The address of a variable may or may not be known at compile time. If the address is known at compile time then we can name the variable and refer to it by either its name or its address. Variables generated at runtime are anonymous and can only be referred to by their address (which we must store in another variable known as a pointer variable). Conversely, register variables must always be named, but they have no identity.

Regardless of whether a variable has a name, an identity, or both, the machine simply cannot operate upon values without using variables.

How many levels of inheritance can be possible with multi level inheritance?

There is no limit actually. But, it is preferable to keep the levels under 6-7 for ease of use and maintenance

Why java know as true object oriented language?

Java is not a true object-oriented language.

One of the requirements for such a title is that everything must be an object. Java contains non-object primitive values (such as int, float, boolean, etc.).

What type of imaging method is SPECT?

Single proton (or photon) emission computed tomography (SPECT) produces three-dimensional images of an organ or body system.

How many editor in which you can create java source code?

Java source code is a plain text file, so you can use practically any editor, for example NotePad (included in Windows) or better programs such as the freeware NotePad++. However, it is usually more convenient to use the editor included in an IDE that has support for Java.

Why inline function cannot be static?

Inline functions can be static. However, their usage outside of classes in C++ has been deprecated (a hangover from C). Static member functions are allowed of course, and they can be inline expanded where desired. In C, a static function simply has limited scope within the same translation unit. In C++, unnamed namespaces are the preferred method of achieving the same end.


How do you write a java code that executes or runs many times?

Use loops.

int i;

// for loop

for(i = 0; i < 10; ++i) {

System.out.println(i);

}

// do loop

i = 0;

do {

System.out.println(i++);

} while(i < 10);

// while loop

i = 0;

while(i < 10) {

System.out.println(i++);

}

Each of the above blocks of code will print the values 0-9. Replace the body of the loops to make the code it executes useful. Replace the conditions to change when the loops exit.

What is java joptionpane?

Java's jOptionPane from the javax.swing library is a GUI element for, essentially, an option dialogue box.

How can run java application on android?

This depends on your handset.

Certain devices are java-enabled, older ones are not.

How do you write a Java program to implement weighted queue using circular doubly linked list?

Add weights to the elements of the queue and use an algorithm to sort the queue every time an element is added.

What is javax in java?

java.* libraries were supposed to have been core libs, and javax.* to be standard extensions with the possibility of promotion to core libs (i.e., classes in javax libs could be promoted to java namespaces). However, this showed a certain lack of foresight by not considering the fact that moving the namespaces would require everyone using the classes to change their references-- the criterion for promotion being the adoption rate of the library also guaranteed that the impact to existing code would be the greatest for any functionality promoted. Nowadays, the difference is largely academic since the widely adopted javax.* libs are included in the core download, but the namespaces aren't changed. In practice, it's more important what is in the JRE download than what namespace something is in.

Definition of multilevel inheritance in java?

Multilevel Inheritance

A Scenario where one class is inheriting/extending the bahavior of another class which in turn is inheriting behavior from yet another class.

Ex: public class Automobile {…}

Public class Car extends Automobile {…}

Public class Ferrari extends Car {…}

This multilevel inheritance actually has no limitations on the number of levels it can go. So as far as java goes, it is limitless. But for maintenance and ease of use sakes it is better to keep the inheritance levels to a single digit number

Why do you need testing in computer program?

Because computer programs can fail. If you ever tried to write a computer program, you would know that even fairly simple programs will rarely work as intended, due to the complexity of the programming.

What are Field Types in Access?

Data types.

Field types in Access (The absolute lowlevel Database engine, just above text files) include:

Text

Number

Yes / No

These fields all have charistica that decide length, decimal spaces, default values and such. Using the correct field types for data, and not just text for it all, will result in faster computing and easier coding.

Why are there both primitive and object versions of integers doubles floats characters and booleans?

Primitive data types like int, float etc are available for us to perform primitive data type operations like addition, subtraction, comparison etc. But since Java is an object oriented language, there are many features in java where such primate data types cannot be used. Only objects can be used. So for using the features of such data types there also we have wrapper classes that would create objects for these primitive data types.

What is the use of Default statement in switch case?

C++ Provides a multiple branch selection called as switch. This selection statement succesively test against a list of integer or character constants. When a match is found the statements associate with constants are executed.

When no match is found default statement is used.