Can you access a protected member from a Sub class outside the package of its Base class?
Protected members of a class are only accessible to its subclasses and to friends of the class or its subclasses. However, if a subclass changes the access to private, only the subclass and its friends have access but this does not affect the access rights of its ancestors or their friends.
What do array elements all have in common?
They are all of the same type and they all have an index position that signifies their location in the array
isolation
:: A set of instructions transferred between an artist in the audience::Apex
Why do modern machines consist of multiple levels of virtual machines?
Modern machines do not consist of multiple levels of virtual machines; that is a function of the host operating system's virtual machine manager and its guest operating systems, all of which are implemented through software. The operating system's virtual machine manager exposes one or more virtual machines upon which you can host one or more guest operating systems and their applications. In order to execute compiled Java applications upon one of these guest operating systems you will also need to install the Java virtual machine for that specific operating system. Thus you end up with a Java program executing within a Java virtual machine executing within a virtual machine executing within a virtual machine manager executing upon the physical hardware. The physical hardware itself may be optimised to handle virtual machine managers more efficiently, but the virtual machine manager is a software program; it is not part of the physical machine architecture
What are the operation performed by MPU?
The basic operations performed by MPU are under as follows:
(1)Memory Read
(2)Memory Write
(3)Input/Output Read
(4)Input/Output Write
What are importance of algorithm?
Algorithms are the foundation of computer Science, it is telling the computer to do the task in the most efficient matter. An algorithm is particularly important in optimizing a computer program, the efficiency of the algorithm usually determines the efficiency of the program as a whole.
What does the assert keyword do in Java?
assert is a keyword added in Java version 1.4.
assert tests the programmer's assumption during development without writing exception handlers for an exception. Suppose you assumed that a number passed into a method will always be positive. While testing and debugging, you want to validate your assumption. Without the assert keyword, you will write a method like:
private void method(int a) {
if (a >= 0) {
// do something that depends on a not being negative
} else {
// tell the user that a is negative
}
}
This is simple exception handling; consider the case of big one. Assertion will come into the picture when you don't want to take the time to write the exception handling code.
Consider the above program with assertion:
private void method(int a) {
assert (a>=0); //throws an assertion error if a is negative.
// do stuff, knowing that a is not negative
}
In this program, assert (a>0) will pass when 'a' is only positive. Isn't this much cleaner than the previous example? If the value of 'a' is negative, then an AssertionError will be thrown.
There are two types of assertions:
Example of a really simple assertion:
private void method() {
assert (x>0);
//do more stuff
}
Example for simple assertion:
private void method() {
assert (x>0) : "X is" + x ;
// do more stuff
}
The difference between these two is that the simple assertion - the second example - appends the expression after the colon to the error description in the stack trace.
Note: assertion code - in effect - evaporates when the program is deployed.
For assertion first you need to invoke the assertion.
Asserts are disabled by default in the JVM. In order to run a program with asserts you must use the -ea command line parameter (i.e. java -ea AssertTest).
Even though your compiler suggested it was using java version 1.4, it wasn't actually because you compiled using the "javac [files]" command instead of the "javac -source 1.4 [files]" command. Assertions only work in version 1.4 and later versions.
When you are using assert keyword, you have to enable it. Otherwise it wont give any result.
java -enableassertions classfile
Difference between super and final keyword?
this is a reference to the current class
super is a reference to the super class of the current class (the class from which this class extends). You can use super.super if you want to access the second level class. (The class your parent class extends) The purpose of having thisand super keywords is to differentiate between methods and variables in classes that may have the same name as that in the parent class. Under such situations if we want to ensure that only the methods from a particular class only gets called we can use this and super.
Which OS does not support JAVA?
This is hard to say with any certainty, since there are very many operating systems out there. Most of those operating systems don't have a large enough user/developer base to warrant an implementation of Java.
Officially, Sun only offers downloads for: Linux, Solaris, Windows, and (via Software Update) OS X.
Of course, Sun isn't the only group allowed to implement Java, which makes answering this question all that much more difficult.
IBM, for example, also supports z/OS and AIX (as well as Windows and Linux again).
BufferedWriter is the class which has a method called newLine() which actually writes a platform specific new line character and this method is not there in FileWriter class
super economy class is a mid-ranged product between economy and business class. it was designed to give you a better flight for around the price of economy. super economy offers better features such as extra legroom, seats are wider and there is more seat recline. the meal and beverage service, however, is the same or very similar to that served in economy class.
the super economy class was introduced because air travel companies were hard up and needed something to increase their profits and give them more customers. this provided both although only in America, Europe and Scandinavia. however some airlines have deigned this new style of flight as costly and unneccesary and have abolished it within their companies and stuck to economy. there are several opinions on the new sysytem and all of them have a degree of credibility. the fact, is that super economy will only work with the airlines that market it right.
What is the full form of oak in java?
Oak was a programming language created by James Gosling in 1991, initially for Sun Microsystems set-top box project. The language later evolved to become Java.
The name Oak was used by Gosling after an oak tree that stood outside his office.
Cluster Sampling
What are the advantages and disadvantages of Associative model?
With the Associative model there is not record. When assembling all of the current information on a complex order the data storage needs to be re-visited multiple times. This could pose as a disadvantage. Some calculations seem to suggest that Associative database would need as many as four times the data reads as the relational database.
Can a super class varialble can reference a subclass object in java?
No. Because, what is the guarantee that when the super class code is being executed there will always be a sub class?
But, the other way round - sub class object accessing a super class variable is possible because, if a sub class uses inheritance to extend from another class, then it is 100% sure that the parent class is going to be around. So a sub class can access the super class variable.
123
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%.