When the class b is inherited from class a class a is called what?
Class B is said to be a "subclass" of class A.
What do you mean by multithreaded program Explain the life cycle of a thread?
Thread exists in several states. A thread just created is in the born state. When the threads start
method is called, it enters the runnable (ready) state. Then the system assigns a processor to the thread.
A thread enters the dead state when its run method completes or terminates for any reason. When a sleep
method is called in a running thread, that thread becomes ready after the designated sleep time expires.
Even if a processor is available, sleeping thread can not use it.
A running thread can enter a blocked state.
Why is it called a language when UML is a bunch of diagrams?
... for the same reason sign language is not a just bunch of pictures or gestures.
Sign language uses a system of manual, facial, and other body movements as the means of communication.
UML uses visual elements - icons, lines, arrows, etc - as the means of communication.
What are the benefits of inheritance in java programming?
One of the key benefits of inheritance is to minimize the amount of duplicate code in an application by sharing common code amongst several subclasses. Where equivalent code exists in two related classes, the hierarchy can usually be refactored to move the common code up to a mutual superclass. This also tends to result in a better organization of code and smaller, simpler compilation units.
Inheritance can also make application code more flexible to change because classes that inherit from a common superclass can be used interchangeably. If the return type of a method is superclass
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 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.
Why direct coupling is called as darlington method?
I believe that the name came from the person who invented the device.
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.