What is the Feldenkrais Method?
A method of "somatic education" which means learning through movement. See http://www.feldenkrais.com.
How do you fix a runtime error 91 object variable not set?
Microsoft suggest that we can fix error 91 by creating a new registry key. To create a new key follow the steps below:
Click on Start
Type Regedit in the search box
Press Enter
Locate the following entry in the registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Transaction Server
Now select the transaction server and right click on it
Select New and then choose Key
Name the key as Debug
Right click on the Debug key and choose New
Now select Key and name the key as RunWithoutContext
What is finalize and finalize-and finalized?
The idea of the finalizer method was to do clean up stuff, like releasing IO resource to a database
or a file, as this method is called just before the garbage collector removes the object from memory.
The problem is that you cannot influence when or IF the garbage collector will clean up your object,
so you have no guarantee that the finalize method is ever called.
There are even more issues with the finalizer method, the shorty story is to just avoid it
and use a "try finally" block instead - closing the resources in the finally block will guarantee that
the resources will be released.
If you want to know more, I have a free video both about the finalizer method as well as exception handling on my blog (just Google for "Marcus Biel Clean Code Course")
What is method overloading in vb net?
In object-oriented programming (OOP), programmers can create virtual copies of objects from schematics called classes. Classes contain variables of data and methods that can perform tasks with the object or other objects. For a real-world example, a class called "cook" might have variables containing various cooking times and methods for chopping vegetables. Methods can accept data input and provide data output. When a method is programmed to accept different types of data for different occasions, this is called "overloading" a method.
Overloading provides an easy way for methods to keep the same name but allow for different inputs. At compiling time, the application evaluates the input data and chooses which overloaded method to use. By overloading methods, a programmer can also keep a single name for a method despite type differences, which cleans up the code.
How to Overload a Method
Overloading a method in visual basic requires the addition of the keyword "Overloads" into the method definition. The keyword is placed in between the visibility call (i.e. public or private) and the function call (e.g. Public Overloads Function). Each different function definition must have the same name and a different number or type of input variable.
What is topleval class in java?
The top level class in Java is "Object." All other classes are subclasses of Object by default.
How do you store images in Microsoft Access using Java?
File file=new File("c:\\Time.jpg");
PreparedStatement ps=connection.prepareStatement("insert into Table1 (image_id, image_data) values(?,?);");
ps.setInt(0,124);
ps.setBinaryStream(1,in,(int)file.length());
ps.execute();
Any sort algorithm where data is distributed from its input to multiple intermediate structures which are then gathered and placed on the output.
Enter a alphabet and cheak weater it is a vowel or not in java a program?
import java.util.Scanner;
public class main(){
public static void main(String[]args){
Scanner er=new Scanner(System.in);
char letter = " ";
System.out.print("enter a letter");
letter = er.nextChar();
if (letter =='a' letter =='A' letter =='e' letter =='E' letter =='i' letter =='I' letter =='o' letter =='O' letter =='u' letter =='U'){
System.out.print("its a vowel");
}
else {
System.out.print("not a vowel");
}
}
}
Why parenthesis are never needed in prefix or postfix notation?
Because there is not an "order of operations" in prefix or postfix notation. The order in which you put the numbers and operators is the order in which calculation occurs.
Use of valueOf function in java?
The valueOf functions are used in the Java wrapper classes to convert between types. Common uses are converting a number to a String or vice versa. You are encouraged to use these functions instead of creating a new object from a constructor because of the way Java caches values. A call to valueOf will give you the same result as creating a new object, but it may be more efficient if you're creating the same values multiple times.
Difference between list and set in java?
A List is an ordered collection of elements.
A Set is a collection of unique elements.
Sets should be used when you want to store objects without duplicates. Lists should be used any time you need to store an unknown number of objects.
Well my class is on good track and teachers feel us very comfortable its so nice to join this type of atmosphere.
How do you select a version of Java?
The official site has a feature where it will check the version on your computer & tell you if you have the latest one & then offer download if you don't.
A for loop works similarly to most programing languages. An example of a for loop is
for(i=0; i<10; i++)
{
}
The code you want to be operated every loop should be between the brackets. The first part of a for loop is the declaration. The second part, is the comparison used to determine if the loop should continue, and the third part is what operation should be done after every loop.
The Basic for Loop
The for loop is especially useful for flow control when you already know how many times you need to execute the statements in the loop's block. The for loop declaration has three main parts, besides the body of the loop:
• Declaration and initialization of variables
• The boolean expression (conditional test)
• The iteration expression
The three for declaration parts are separated by semicolons. The following two examples demonstrate the for loop. The first example shows the parts of a for loop in a pseudocode form, and the second shows a typical example of a for loop.
for (/*Initialization*/ ; /*Condition*/ ; /* Iteration */) {
/* loop body */
}
Ex:
for (int i = 0; i<10; i++) { System.out.println("i is " + i); }
The Basic for Loop: Declaration and Initialization
The first part of the for statement lets you declare and initialize zero, one, or multiple variables of the same type inside the parentheses after the for keyword. If you declare more than one variable of the same type, then you'll need to separate them with commas as follows:
for (int x = 10, y = 3; y > 3; y++) { }
The declaration and initialization happens before anything else in a for loop. And whereas the other two parts-the boolean test and the iteration expression-will run with each iteration of the loop, the declaration and initialization happens just once, at the very beginning. You also must know that the scope of variables declared in the for loop ends with the for loop! The following demonstrates this:
for (int x = 1; x < 2; x++) { System.out.println(x); // Legal } System.out.println(x); // Not Legal! x is now out of scope If you try to compile this, you'll get something like this: Test.java:19: cannot resolve symbol symbol : variable x location: class Test System.out.println(x); ^
Basic for Loop: Conditional Expression
The next section that executes is the conditional expression, which (like all other conditional tests) must evaluate to a boolean value. You can have only one logical expression, but it can be very complex. Look out for code that uses logical expressions like this:
for (int x = 0; ((((x < 10) && (y-- > 2)) | x == 3)); x++) { }
The preceding code is legal, but the following is not:
for (int x = 0; (x > 5), (y < 2); x++) { } // too many //expressions The compiler will let you know the problem: TestLong.java:20: ';' expected for (int x = 0; (x > 5), (y < 2); x++) { } ^ The rule to remember is this: You can have only one test expression. In other words, you can't use multiple tests separated by commas, even though the other two parts of a for statement can have multiple parts.
Basic for Loop: Iteration Expression
After each execution of the body of the for loop, the iteration expression is executed. This is where you get to say what you want to happen with each iteration of the loop. Remember that it always happens after the loop body runs! Look at the following:
for (int x = 0; x < 1; x++) { // body code that doesn't change the value of x } The preceding loop executes just once. The first time into the loop x is set to 0, then x is tested to see if it's less than 1 (which it is), and then the body of the loop executes. After the body of the loop runs, the iteration expression runs, incrementing x by 1. Next, the conditional test is checked, and since the result is now false, execution jumps to below the for loop and continues on. Keep in mind that barring a forced exit, evaluating the iteration expression and then evaluating the conditional expression are always the last two things that happen in a for loop! Examples of forced exits include a break, a return, a System.exit(), or an exception, which will all cause a loop to terminate abruptly, without running the iteration expression. Look at the following code: static boolean doSomething() { for (int x = 0; x < 3; x++) { System.out.println("in for loop"); return true; } return true; } Running this code produces in for loop The statement only prints once, because a return causes execution to leave not just the current iteration of a loop, but the entire method. So the iteration expression never runs in that case. Basic for Loop: for Loop Issues None of the three sections of the for declaration are required! The following example is perfectly legal (although not necessarily good practice): for( ; ; ) { System.out.println("Inside an endless loop"); } In the preceding example, all the declaration parts are left out so the for loop will act like an endless loop. For the exam, it's important to know that with the absence of the initialization and increment sections, the loop will act like a while loop. The following example demonstrates how this is accomplished: int i = 0; for (;i<10;) { i++; //do some other work } The next example demonstrates a for loop with multiple variables in play. A comma separates the variables, and they must be of the same type. Remember that the variables declared in the for statement are all local to the for loop, and can't be used outside the scope of the loop. for (int i = 0,j = 0; (i<10) && (j<10); i++, j++) { System.out.println("i is " + i + " j is " +j); } The last thing to note is that all three sections of the for loop are independent of each other. The three expressions in the for statement don't need to operate on the same variables, although they typically do. But even the iterator expression, which many mistakenly call the "increment expression," doesn't need to increment or set anything; you can put in virtually any arbitrary code statements that you want to happen with each iteration of the loop. Look at the following: int b = 3; for (int a = 1; b != 1; System.out.println("hii")) { b = b - a; } The preceding code prints hii hii
public class Student {
private int id;
private String name;
private String place;
private int contact;
public Student(){
}
public Student(String studentName, int studentId){
name = studentName;
id = studentId;
}
public int getId(){
return id;
}
public String getName(){
return name;
}
public String getPlace(){
return place;
}
public int getContact(){
return contact;
}
public void setId(int studentId){
id = studentId;
}
public void setName(String studentName){
name = studentName;
}
public void setPlace(String studentPlace){
place = studentPlace;
}
public void setContact(int studentContact){
contact = studentContact;
}
Java was developed in the early 1990's by James Gosling at Sun Microsystems. Java was introduced to the public in 1995.
An accessor is a method in a Java Bean that is used to access the private variables of the class.
Usually instance variables in a bean are declared as private and they can be accessed only via these accessor methods.
Ex:
public class Employee {
private String name = "";
private int age = 0;
public String getName(){
return this.name;
}
public void setName(String nm){
this.name = nm;
}
public int getAge(){
return this.age;
}
public void setAge(int ag){
this.age = ag;
}
}
In the above example name and age are instance variables and the methods beginning with get and set are the accessor methods.
There are many different operators, which are you referring to?
What do parameters and return values have to do with methods?
Parameters and return values are a major part of methods. When defining a method, you must include information about the data types of the return value and the parameters. An example of a method definition is this:
public int getSumOfNumbers( int number1, int number2, int number3 )
{ return ( number1 + number2 + number3 ); }
The word "int" right after the word "public" is the return type. It describes what data type will be returned by the method. In this case, it was int, or integer.
The sequence of words in between the parantheses, "int number1, int number2, int number3", is the parameter list. Each of the phrases separated by a comma in the parameter list is a parameter. The first word - in this case "int" - is the data type of the parameter. It describes what type of variable the parameter will be. The second word - "number1", "number2", or "number3" - is the name of the parameter.
Every parameter must have a data type and a name, and every method must have a return type: even a method that returns nothing. For example:
public void evaluateNumber(int number)
{ if ( number > 0 )
{ System.out.println( number + " is positive." ); }
else if ( number < 0 )
{ System.out.println( number + " is negative." ); }
else
{ System.out.println( number + " is zero." ); }
}
When a method does not return data, its return type must be defined as void, as it is above.
Why programming efficiency is important today?
Efficiency saves time, and time is money. It removes unneeded loops from programs, and the efficient code is usually easier to manage because it means a disciplined programmer.
import java.io.*;
class Files
{
public static void main(String a[])throws IOException
{
int i,line=0,c=0,len;
char k;
boolean m;
File f=new File("info.txt");
FileInputStream f1=new FileInputStream("info.txt");
len=f1.available();
for(i=0;i<=len;i++)
{
k=(char)f1.read();
c++;
System.out.print(k);
if(k='/n')
{
line++;
System.out.println(+line);
}
}
System.out.print("number of characters="+c);
}
}
int main() {
int x, y;
char op;
int res;
printf("Enter two numbers and a operator\n");
scanf("%d %d %c", &x, &y, &op);
switch (op) {
case '+':
res = x+y;
break;
case '-':
res = x-y;
break;
case '*':
res = x*y;
break;
case '/':
res = x/y;
break;
default:
printf("Unknown operator %c\n", op);
exit(1);
}
printf("Resault is %d\n", res);
return 0;
}
#include
void math_operations(char operation, int arg1, int arg2);
using std::cout;
using std::cin;
using std::endl;
int main()
{
int num1 = 0;
cout << "Enter first number: ";
cin >> num1;
int num2 = 0;
cout << "Enter second number: ";
cin >> num2;
char operation = '+';
cout << endl << "Enter the operation:"
<< endl << "+ for addition"
<< endl << "- for substruction"
<< endl << "* for multiplication" << endl;
cin >> operation;
cout << endl << "You chose: ";
math_operations(operation, num1, num2);
system("PAUSE");
return 0;
}
void math_operations(char operation, int arg1, int arg2)
{
if (operation '-')
{
cout << "-" << endl;
cout << arg1 << " - " << arg2 << " = " << (arg1 - arg2);
}
else
{
cout << "*" << endl;
cout << arg1 << " * " << arg2 << " = " << (arg1 * arg2);
}
}
* The program was checked in VS2008
Structured programming concepts in c?
Structured programming is a programming paradigm aimed on improving the clarity, quality, and development time of a computer program by making extensive use of subroutines, block structures and for and while loops - in contrast to using simple tests and jumps such as the goto statement which could lead to "spaghetti code" which is both difficult to follow and to maintain.
Write a program to copy the value of one string variable to another variable?
You can have two String variables (note that String variables are object references) refer to the same String object like so:
String str1 = "Hello";
String str2 = str1;
Now the str1 and str2 are references for the same String object containing the word "Hello".
If you actually want a new String object with a copy of the contents of the original String, you use the String constructor that takes a String argument, like so:
String str3 = new String(str1);
Now str1 and str3 refer to SEPARATE String objects that happen to contain the same sequence of characters (the word "Hello").
Since Strings objects in Java are immutable, they can be shared without worrying about the contents used by one variable being upset by the use through another variable as might happen with char[] arrays in C or C++ so the first method is probably sufficient for most cases.