What class is the Chordophone in?
The chordophone is a class of musical instruments that produce sound primarily through the vibration of strings. This class includes instruments such as violins, guitars, and harps. Chordophones can be further categorized into different types based on their construction and how the strings are played, such as bowed, plucked, or struck. They are one of the four main categories in the Hornbostel-Sachs classification system, which organizes instruments based on their sound production methods.
What is a program to sort a two dimensional integer array?
Any multi-dimensional array can be flattened into a linear array. For instance,
[[1,2,3],[4,5,6],[7,8,9]]
can be flattened into
[1,2,3,4,5,6,7,8,9].
So a solution to your problem (certainly not the most efficient) would be to flatten the 2d array into a linear array, and sort using a traditional sorting algorithm or Arrays.sort. You would then insert the sorted elements back into the 2d array. This would have nlog(n) complexity.
An implementation below:
public static void sort2d(int[][] arr)
{
int r = arr.length;
int c = arr[0].length;
int[] flat = new int[r*c];
for (int i = 0; i < r; i++)
for (int j = 0; j < c; j++)
flat[i*c+j] = arr[i][j];
Arrays.sort(flat);
for (int i = 0; i < flat.length; i++)
arr[i/r][i%c] = flat[i];
}
WHAT IS A specific instance of a class is called?
Specific instance of a class is called object of that class.
What is the difference between the public and default access specifiers?
Here is a brief explanation of the access modifiers allowed in Java: default: objects are visible from within their own class, or any other class in the same package. public: objects are visible from within their own class, or from any other class within the project (regardless of which package it is in). protected: objects are visible from within their own class or any other class within the same package; objects are also visible from any class that is a subclass. private: objects are only visible from within from within their own class. It is important to note that all but the default access modifier need to be specified. For example: public String foo; (public) protected String foo; (protected) private String foo; (private) String foo; (default) For more information on this topic, you can read this page: http://java.sun.com/docs/books/tutorial/java/javaOO/accesscontrol.html
Answer:
Public access modifier Fields, methods and constructors declared public (least restrictive) within a public class are visible to any class in the Java program, whether these classes are in the same package or in another package. public classes, methods, and fields can be accessed from everywhere. The only constraint is that a file with Java source code can only contain one public class whose name must also match with the filename. If it exists, this public class represents the application or the applet, in which case the public keyword is necessary to enable your Web browser or appletviewer to show the applet. You use public classes, methods, or fields only if you explicitly want to offer access to these entities and if this access cannot do any harm.
Default access modifier Java provides a default specifier which is used when no access modifier is present. Any class, field, method or constructor that has no declared access modifier is accessible only by classes in the same package. The default modifier is not used for fields and methods within an interface. If you do not set access to specific level, then such a class, method, or field will be accessible from inside the same package to which the class, method, or field belongs, but not from outside this package. This access-level is convenient if you are creating packages. For example, a geometry package that contains Square and Tiling classes, may be easier and cleaner to implement if the coordinates of the upper-left corner of a Square are directly available to the Tiling class but not outside the geometry package.
What is the name of the method used to schedule a thread for execution?
"start"
You've created a Thread object and it knows its target. Now it's time to get the whole thread thing running. It's pretty straight forward:
t.start();
Prior to calling start() on a Thread instance, the thread (when we use lowercase t, we're referring to the thread of execution rather than the Thread class) is said to be in the new state as we said. The new state means you have a Thread object but you don't yet have a true thread. So what happens after you call start()?
• A new thread of execution starts (with a new call stack).
• The thread moves from the new state to the runnable state.
• When the thread gets a chance to execute, its target run() method will run.
write a java application that generate custemer account balance in a banking system?
Why direct coupling is called as darlington method?
I believe that the name came from the person who invented the device.
Why array indexes starts from zero in c-language?
In order to provide modulo (%) facilities as far as mathematics and logic is concern.
for instance , if we have no of employees in our list say 1545 and if we want to accommodate it within small and effective range then by using % we can do it easily....
we can arrange it in the range within Array with maximum index 14 (0,1,2,.....14).
And 0,15,30,45......1545 will belongs to same category say index no 0.
Think if 0 is not included into index then where we would store 0,15,30,45....1530,1545 .
From a technical standpoint, you need to understand that an array is basically just the starting address of a chunk of memory. The "index" of the array is actually an address offset. So the value at the 0th position would be stored at the address of the array plus zero. The value at the 1st position would be stored at the address plus one, and so on.
How do you compute the product of integers 1 to 10 in JAVA?
There are, of course, several ways to do this, but the simplest way is probably using a "for" loop:
int product = 1;
for(int i = 1; i<= 10; i++) product *= i;
Abstract class can be private?
A class can either be default or public it can never be declared as private, so the question of abstract class at the file level does not arise. But an inner class can be declared private and abstract as well.
You normally create a thread when you want to run a function in the background while processing other things.
Define the java terms of accessor?
Accessors are methods defined inside classes to access the private variables of the class. It is always a good practice to have instance variables as private so that, other classes cannot access them directly. This would avoid unwanted modification of data. These variables can be accessed only via their respective accessor methods. Ex: public class Test { private String name = ""; public String getName(){ return this.name; } Public void setName(String val){ this.name = val; } } Here getName and setName are the accessor methods for the variable name.
Start with only a single LWP and let it select a runnable thread. When a
runnable thread has been found, the LWP creates another LWP to look for a
next thread to execute. If no runnable thread is found, the LWP destroys itself.
What is declaration syntax of an array?
In what language?
c and c++
a 5 x 5 array of Int
int nMultiIntArray[5][5];
Answer:
in java
int array[][]=new int[5][5];
in vb
dim array(5,5) as Integer
How do you calculate execution time of an exe file?
Use a high-resolution timer such as the HPET (high performance event timer).
What is an adequate measure of the size of input for a program that requires two integer numbers n?
Not sure what you mean; if you want to measure the "input size" in bytes, that would probably be 8 bytes, since integers typically use 4 bytes.