What are attributes and methods in class?
Attributes are the class member variables, the data, fields or other properties that define the class state. Methods are the functions of a class, the operations that define its behaviour, typically working in conjunction with the class member attributes to either alter the class state (mutators) or query the class state (accessors). Special methods such as the class constructors, its destructor and conversion operators are invoked indirectly through compiler-generated code while all others are called directly via programmer-generated code.
It is useful when the situation calls for it. For example, a static int called instanceCount that counts the number of instances of a given class that exist on the heap would definitely be shared using the keyword "static" in front of the type in the declaration because if it were not static, the count would be reset every time someone made a new object.
Scope of static variable is with in the file if it is static global.
Scope of static variable is with in the function if variable is declared local to a function.
But the life time is throughout the program
http://wiki.answers.com/Q/How_does_knowledge_of_Java_programming_concepts_benefit_individuals_working_in_almost_any_IT_position"
How do you deploy a VB DLL in java?
use VC++ as a bridge between VB and Java. there seems to be no easier way than that. good luck.
use VC++ as a bridge between VB and Java. there seems to be no easier way than that. good luck.
Of course. The synchronized keyword will ensure that only one thread will ever be allowed to execute a method at once. If two threads are attempting to access two different methods, then each method only has one thread executing it.
Can transient variables be declared as 'final' or 'static'?
Transient Variables are those that do not get serialized during the Serialization process.
A Static variable is one that is mapped to the Class and is not mapped to any object instance and hence they would not get serialized. So, there should be no problem with declaring a transient variable as static.
On the other hand, A final variable is one that's value cannot change. So if you declare a final variable as transient, it would get stored as null during serialization and when you try to de-serialize the variable, you will get errors because, the variable is final and you cannot assign values for it and it is saved as null during serialization.
Result: Yes you can have static transient variables but not final transient variables.
Is it possible to print both if statement and else statement?
Yes
int main (void) {
puts ("if statement");
puts ("else statement");
return 0;
}
What is the components of OOPS?
Java is an object oriented programming language. The various object oriented concepts in it are:
* Class * Object * Instance * Method * Inheritance * Polymorphism * Abstraction * Encapsulation etc...
Anything that is simplified depiction of a far more complex object or concept?
That's called a "model".
That's called a "model".
That's called a "model".
That's called a "model".
What do you mean by protected derivation of a sub class from base class?
When you derive a class (the sub-class) from a base class using protected access, all public members of the base class become protected members of the derived class, while protected members of the base class will remain protected. Private members are never inherited so they remain private to the base class.
By contrast, if you use public inheritance, the public members of the base class remain public to the derived class, while protected members of the base class remain protected in the derived class. If you use private inheritance, both the public and protected members of the base class become private to the derived class.
Note that accessibility cannot be increased, only reduced or left the same. That is, a protected member of a base class cannot be inherited as a public member of a derived class -- it can only be declared private or remain protected.
Note also that accessibility is viewed from outside of the derived class. That is, all members of a base class other than the private members are inherited by the derived class and are therefore fully accessible to the derived class. But from outside of the derived class, all base class accessibility is determined by the access specified by the type of inheritance.
What is persistence in oops explain with example?
The phenomenon where the object outlives the program execution time & exists between execution of a program is known as persistance
How do you generate quantum program using spss?
The Question is slightly unclear. If you have a SPSS file and you want to generate the Quantum program you can use the utility called spss2qt. This is a small program in SPSS that will convert the SPSS data into ASCII data with a Quantum program with proper column location. However you will have to modify the program to display output to your requirement as this utility will give very basic quantum program for the data. Regards Sachin You can reach me on sacsar@yahoo.com
the Math class contains a number of mathematical functions that we may commonly need to use in our programs. Instead of coding it ourselves, the founders of java have created a class that would help us with the same.
For example:
Math.round() is used to round off a decimal value to its nearest whole number
Math.cos() will return the mathematical cosine of the value
Math.log() will return the logarithmic value of the number
etc...
What is the difference between function and method?
functions have independent existence means they are defined outside of the class e.g. in c main() is a function while methods do not have independent existence they are always defined inside class e.g. main() in Java is called method.
########
I've been studying OOP lately and had this question myself, so I will share my thoughts;
I was taught that "A Function should do 1(one) thing and do it well."
In specific Regards to PHP;
The difference between a Method and a Function is that a Method is tied to a specific class.
Hope this helps.
--------------------------------------------------------------------------------------------------------
function can return value where as method can't that is the main difference between function and method
---------------------------------------------------------------------------------------------------
Actually you are describing the difference between a function and a procedure. Function returns a value, procedure does not unless you are using c#, then everything is a function.
In c# a function, to paraphrase the first answer, does and thing and does it well. A method contains functions. The most important method is the Main method. All functionality of a program must be referenced in the Main method because when you run a program, it starts at the beginning of the Main method, and stops wehn it hits end of the Main method.
Where can one learn about JSF implementations?
One can learn about JSF implementations, Of course on Java it's self. Another way one can learn about JSF implementations is at a public library one can look at a book related to the topic.
If you compiled it yourself, you should usually place it in /usr/local
A function is a block of code that has a name and it has a property that it is reusable i.e. it can be executed from as many different points in a C Program as required.
Function groups a number of program statements into a unit and gives it a name. This unit can be invoked from other parts of a program. A computer program cannot handle all the tasks by it self. Instead its requests other program like entities - called functions in C - to get its tasks done. A function is a self contained block of statements that perform a coherent task of same kind
The name of the function is unique in a C Program and is Global. It neams that a function can be accessed from any location with in a C Program. We pass information to the function called arguments specified when the function is called. And the function either returns some value to the point it was called from or returns nothing.
We can divide a long C program into small blocks which can perform a certain task. A function is a self contained block of statements that perform a coherent task of same kind.
Structure of a Function
There are two main parts of the function. The function header and the function body.
int sum(int x, int y)
{
int ans = 0; //holds the answer that will be returned
ans = x + y; //calculate the sum
return ans //return the answer
}
A variable used to store a value being computed in increments during a loop's execution is called?
an accunmulator
How do you check whether the given no is prime or not in java?
Use Euclid's algorithm to find the greatest common factor. This algorithm is much simpler to program than the method taught in school (the method that involves finding prime factors). If the greatest common factor is 1, the numbers are relatively prime.