What are legal int literals 22 1.5 -1 2.3 10.0 5 -6875309 '7'?
Java ints can be any whole number between 2147483647 and -2147483648
22 int
1.5 (illegal as it's a float)
-1 int
2.3 (illegal as it's a float)
10.0 (illegal as it's a float)
5 int
-6875309 int
'7' is a legal int, but it won't be a seven, but the decimal ASCII equivalent (assumes a single character in apostrophes is a char). '7' is 55
If i need to write a spelling game in java how do i go about doing this?
Spelling game does what?
Please enter your idea of the game so that i can work for your programme
What is the default value of integer in java?
According to the JLS, the default value of an int is 0. The default value of an object of type Integer is null.
Of course, this applies only to class members fields, as local method-level fields must be explicitly assigned a value before use.
Java Remote Method Invocation (JavaRMI)
Equivalent to Microsofts DCOM, a protocol used to remote component communication for the JAVA platform only.
Can you declare printf for integer variable?
printf is declared in stdio.h
Format specifier for an integer value is %d.
Give the structure of multiple inheritance?
Java does not support multiple inheritance. It is done with the help of interfaces in java. a class can implement n number of interfaces, thus showing multiple inheritance. but a class cannot extend multiple classes in java.
A non touching loop is where each iteration does not access data from a different iteration. An optimizing compiler/interpreter can detect this, and spread out the loop between different threads, potentially (with multiple processors) running the loop faster.
An example of a non touching loop is the addition of two arrays. Each iteration accesses one element, and has no dependencies on elements accessed in different iterations.
An example of a touching loop is the summation of elements in an array. Each iteration depends on the result of a different, usually the prior, iteration. Even there, however, the optimization process can spread the work out amongst different threads so long as there are synchronization mechanisms in place.
What is the purpose of the keyword private?
The private keyword is used to ensure that no other classes will be able to access (view or modify) that class member.
What will happen if you change the data type of a field and what consequences of this action?
It will depend on what type you are changing from and to. You may lose some data. You may not be able to carry out some operations on some data. If something has gone from number to text, that could be the case. You can't convert some types, like text to a number. Programs may not run properly or may crash as a result of some data changes. You may have to redesign some forms and reports when data types change, and also some queries. So if data types have to be changed, it needs to be very carefully done. With proper planning and design to start with, data types should not need to be changed.
How do you motivate your class?
As a current student, be goofy and crazy. Gaining their attention is key for interest. As a teacher if you can capture the interest in a student it will be easier to motivate a him or her.
If this does not help, ask your class or classes yourself how class can be more interesting and intriguing.
Throws exception function in java?
throws exception is a common signature pattern for methods. It is used to signify the fact that the code inside the method may throw exceptions of the types mentioned in the method signature. The calling method must have code to handle the exception effectively.
Ex:
public String getName() throws SQLException {
.....
}
This method's code can throw an SQLEXception and the calling method must have the code to handle this exception
Javascript is basically a client side scripting language which is mostly used for more interactive websites, client side validation etc. Ajax is basically asynchronous javascript and XML. So it used javascript but there is a lot more to it. XMLHttpRequest object is used to interact with the server to get the real time data without refreshing the page. There are other alternatives to XMLHttpRequest object like iframe, XMLDocument object but they are not as robust as this one. So XMLHttpRequest object is activated through regular javascript actions and the request is sent to the server. Once the response is recieved, it is thrown back to the browser and diplayed in some previously unfilled variables.
Where can you download Foxpro database software?
You have to buy it. The original FoxPro software was purchased by Microsoft, and is now known as Visual FoxPro. The current and final version of this software is version 9.0. You can buy it online from numerous retailers. If this is for home or educational use, you can often buy much discounted versions of Microsoft software. Otherwise, this is expensive, although well worth the money if you're a DB programmer or need to work with one of the many accounting and other systems written in it.
What is native variable in java?
native is a key word used in java method. there is no variable as native in java
What is the difference between do while and while loop in java?
A do-while loop guarantees the body of the loop will execute at least once. A while loop might not execute at all.
// this code will execute, even though the condition test will always evaluate to false
do {
// stuff
}while(false);
// this code will never execute because the condition test will always evaluate to false
while(false) {
// stuff
}
What is the correct data type of an accumulator variable used to store real estate sales total?
To ensure 100% accuracy, I would use an integer type rather than a floating point type and convert from pence to pounds on the fly if necessary. If you're only interested in whole pounds then an integer is still the way to go (increasing your range by 100 fold). The only issue then is how large a value you need to store in the accumulator. An unsigned 32-bit accumulator can accommodate a running total of up to 4,294,967,295, which converts to £42,949,672.95 or £4,294,967,295 in whole pounds, while an unsigned 64-bit accumulator can accommodate a total of 18,446,744,073,709,551,616, which converts to £184,467,440,737,095,516.16 or £18,446,744,073,709,551,616 in whole pounds. Personally, I'd go with the unsigned 64-bit integer just to err on the side of caution.
Although it's unlikely in this case, should you require negative values, a signed 64-bit integer has a range of 9,223,372,036,854,775,807 to -9,223,372,036,854,775,808.
Note that floating point numbers may incur errors due to rounding. Although such errors may be unlikely in this case, since you are only dealing with 2 decimal places at most, whole numbers are guaranteed to be 100% accurate.
a method that takes the data sent from wherever (eg a web server to a client) and identifies important tokens/data/strings required and stores it in local variables for later use. basically copying webserver data and copying/parsing it into an object.
How you can interchange two integer values using swap variable in c language?
t = a; a = b; b = t; // t is a third integer variable (swap variable)
But here's a way without a swap variable, given as as a macro in C:
#define SWAP(a,b) { if (a!=b) { a^=b; b^=a; a^=b; }} // Swap macro by XOR
Once you define it, you can say swap(x,y) to swap x and y. The numbers kind of flow through each other and end up swapped.
k = you - int (you / j) * j;
You can also use, if your language supports the modulus (%) operator...
k = you % j;
How you find whether character is alphabet or not in java?
Use the Character.isLetter(char letter) method.
// This line will return true
Character.isLetter('a');
// This line will return false
Character.isLetter('4');
Which is the primary need to develop Java programming from C plus plus?
The primary need to convert any language source, including C++, to Java is simply one of portability.
While C++ is itself portable, writing cross-platform code requires that you write code in a more abstract manner than you would when writing for a specific platform, making extensive use of compiler directives to determine which version of each translation unit will be compiled upon which particular platform. This increases code maintenance because you must then maintain separate versions of the platform-specific code, as well as include a different set of headers for each platform, and thus call different functions for each platform. You must also compile the source separately upon each supported platform, which means the code must be as generic as possible in order to be understood by every possible compiler. Thus cross-platform C++ code tends to be limited to the most popular platforms only, which usually means Windows and Unix only.
Java's higher level of abstraction is such that you need only write one set of instructions and compile it one time only. The Java virtual machine handles all the low-level machine specifics, so the same executable will run on any machine that has a Java virtual machine implementation. While this greatly reduces code maintenance and increases portability, the need to interpret the compiled byte code (rather than native machine code which requires no interpretation) reduces performance enormously. Thus the ease of maintenance has to be weighed against the loss of performance to determine if it is a worthwhile exercise.
What mean by multithreaded program?
A multithreaded program is one that has multiple threads in execution. They may execute parallel to one another or totally without relation to one another.
In Java you can create multithreaded programs using Java threads.