What is the difference between object and variable?
A variable basically holds a single type literal in memory through defining its type, declaring it, and setting a value to it. If you meant reference variables, they are variables which refer to the memory location of an object previously set.
An object is the actual storage space in memory in which some collection of data resides (is stored). Objects 'live' in memory spaces known as 'heaps'.
What is the Difference between overflow and carry binary addition?
You have an adder circuit that can hold a maximum value of 100. With the carry it can hold values up to 199, the carry distinguishes between 31 and 131. But if the sum is greater than 199, you have overflow, because the circuit has no way of telling you what the actual value is.
[edit]
you have an overflow when the size of the result doesn't fit to the capacity of the memory sign of the result is different from what is expected (for example, getting a negative result when adding 2 positive numbers) The carry out occur when the size of the result doesn't fit to the capacity of the memory, yet its sign is correct.
Which member should be declared as static?
Members which are shared among all instances of a class should be static.
static storage class in C tells that:
The variable will have the default value as zero.
The variable scope will be the file in which it is defined.
RaVi
Venous access introduces a needle into a vein, usually for the purpose of withdrawing blood or administering medication.
What access attribute should instance variables have?
The basic coding standard is - all variables must be private and you must only expose them to the outside world through accessor/mutator methods. You must not keep them public.
Write a Java program to assign the letter grades to students based on their average scores?
import javax.swing.JOptionPane;
public class StudentGradesWeek7
{
public static void main(String[] args)
{
String input = JOptionPane.showInputDialog ("Enter Student's grade in %");
int inputMark = Integer.parseInt (input);
char g = getGrade (inputMark);
JOptionPane.showInputDialog(null, "Student's grade is " + g);
}
private static char getGrade (int mark)
{
char grade;
if (mark >=70)
grade = 'A';
else if (mark >=60)
grade = 'B';
return;
}
}
Explain different types of variables in shell?
Environment Variables: Sometimes called special shell variables, keyword variables, predefined shell variables, or standard shell variables, they are used to tailor the operating environment to suit your needs. Examples include PATH, TERM, HOME, and MAIL.
User-defined Variables: These are variables that you create yourself.
Positional Parameters: These are used by the shell to store the values of command-line arguments
You get it in the battleon upgrade shop. You have to be member to buy.
Why httpservlet class called abstract?
Because, the creators of the servlet framework cannot give all the functionality that you might want in your application.
So, if they make their class abstract, you the developer will be providing all the functionality you need and still stick to the framework standards defined by them.
Can more than one JDK be installed on single OS?
Yes, just make sure that your classpaths are setup correctly so that you compile and run programs using the desired version of the JDK.
What is advantage of different firing order 351W verses 302?
There is no significant advantage other than less peak twisting stress over the entire length the crankshaft. The firing orders are 1-3-7-2-6-5-4-8 for the 351W and HO 302 motors vs. 1-5-4-2-6-3-7-8 for early 289 and 302 Windsor motors. Connecting rods 1 and 5, 2 and 6, 3 and 7, and 4 and 8 share the same crank journals. Looking at the firing order the early 289/302's fired 1 and 5 at the very front of the crank in order. This placed torque stresses from two cylinders in power stroke on the very front throw of the crank at the end furtherest away from the load of the crank. The later HO and 351W firing order places common power strokes further back in the crank, reducing peak twisting stresses over the length of the crank.
A machine is merely something that performs or assists in performing a task.
The simplest examples of machines are levers, pulleys, and wedges, all of which have probably been around in some form or another since before recorded history. So, I suppose no one really knows how they developed.
What value is return by int main method?
1. A method declared as "int" returns an int value.
2. The main() method in Java is not declared as "int", but as "void", meaning it returns no value.
Design iterative and recursive alogrithm to find the minimum among n elements?
// returns the minimum value in ns - iterative
public static final int findMinIterative(final int[] ns) {
if (ns.length == 0) {
return 0; // return 0 if ns is an empty array
}
// search each element of ns
int min = ns[0];
for (int i = 0; i < ns.length; ++i) {
// if an element smaller than min is found, store that as the new min
if (ns[i] < min) {
min = ns[i];
}
}
return min;
}
// returns the minimum value in ns - recursive
// Note that this problem does not lend itself to recursion; the solution is very similar to the iterative approach
public static final int findMinRecursive(final int[] ns) {
if (ns.length == 0) {
return 0; // return 0 if ns is an empty array
}
// start recursion
return findMinRecursive(0, ns[0], ns);
}
// recursive part of algorithm
private static final int findMinRecursive(final int i, final int min, final int[] ns) {
// bounds check
if (i >= ns.length) {
return min;
}
// recurse on next value of ns
return findMinRecursive(i + 1, Math.min(min, ns[i]), ns);
}
How many constructors does class Exception have?
The Exception class has 4 constructors. They are:
a. Exception()
b. Exception(String arg)
c. Exception(String arg, Throwable arg1)
d. Exception(Throwable arg)
The sum of is the total of everything being summed; the sum total. Thus the sum of a, b and c is therefore a + b + c.