Will the java compiler translate a source file that contains syntax errors?
No it will not. Any java source file that has syntax errors will not be translated fully. The compiler will spit out errors based on the syntax problems in your code.
Write a c program to find the maximum value of 25 element in an array?
int findMax(int *array)
{
int max = array[0];
for(int i = 1; i < array.length(); i++)
{
if(array[i] > max)
max = array[i]
}
return max;
}
What are the features differentiate java from c plus plus and c?
Java compiles to byte code suitable for interpretation by the Java virtual machine, whereas C and C++ both compile to native machine code. Thus C and C++ programs perform better than equivalent Java programs. However, Java programs can run on any machine with a suitable Java virtual machine implementation, which is pretty much everything these days. C and C++ programs must be compiled separately upon each supported platform, provided the source code is either generic or includes compiler directives to filter the platform-specific code. Java programs need only be compiled once, thus cross-platform development is greatly simplified, at the cost of performance.
C and Java cannot really be compared since C does not support object-oriented programming concepts. C++ is object-oriented but, unlike Java, it is not 100% object-oriented as it supports the concept of primitive data types that it inherited from C. Java is more closely related to C#, which is 100% object oriented.
What is active management by exception?
Active management by exception is a management approach that focuses on identifying and addressing significant deviations from planned performance or expected outcomes. Rather than monitoring every detail, managers concentrate on areas where performance falls short or exceeds targets, allowing for more efficient use of resources and time. This strategy enables organizations to respond quickly to issues or opportunities, fostering a more dynamic and proactive management style. Ultimately, it helps in prioritizing critical issues while keeping routine operations running smoothly.
Explain the significance of public and protected and private access specifiers in inheritance?
These are all access modifiers in Java.
a. Public - these are accessible anywhere. This is the least restrictive access specifier.
b. Private - these are accessible only inside the declaring class. This is the most restrictive access specifier.
c. Protected - these are in between public and private. These are accessible to all classes that inherit this class
d. Package - this is the default access specifier. These are accessible to all classes that are present in the same package as the contained class.
The heap refers to the free store, which basically means the total unused memory available to you. The physical amount of memory will vary from system to system and the amount of memory available will depend upon how much is currently in use. However memory fragmentation means that while there may be sufficient physical memory available to meet an allocation request it does not follow that there is a large enough block of contiguous memory available, resulting in an out of memory error.
Modern systems use virtual memory addresses rather than physical ones. This allows the memory manager to physically move objects around in memory without affecting the virtual addresses allocated to those objects and thus makes it possible to consolidate memory fragments. Objects that are not in use can also be paged out to a disk file, thus making it seem like there's far more memory available than physically exists.
Write a java program to find out the sum of a number of n digits?
class Sum_Of_Digits
{
public static void printSumandnoofdigits(int n)
{
int temp = n;
int count = 0;
int sum = 0;
while ( n > 0 )
{
sum = sum + n % 10;
n = n / 10;
count ++;
}
System.out.println("The number is..." + temp );
System.out.println("The sum of digits is..." + sum);
System.out.println("The number of digits is..." + count);
}
}
Write a recursive procedure to compute the factorial of a number?
#include <iostream>
using namespace std;
int main()
{
int i, number=0, factorial=1;
// User input must be an integer number between 1 and 10
while(number<1 number>10)
{
cout << "Enter integer number (1-10) = ";
cin >> number;
}
// Calculate the factorial with a FOR loop
for(i=1; i<=number; i++)
{
factorial = factorial*i;
}
// Output result
cout << "Factorial = " << factorial << endl;
What does the byte code run on?
Bytecode runs on a virtual machine, which interprets or compiles it into machine code that can be executed by the underlying hardware. For example, Java bytecode runs on the Java Virtual Machine (JVM), while Python bytecode runs on the Python interpreter. This abstraction allows for platform independence, enabling the same bytecode to run on different systems without modification.
What is the difference between Rhino and Super liner?
The difference is Rhino is a more grippier substance and Super Liner is more plastic.
atlcom Class is realted to programs made from Visual studio.
If you are getting pop ups run a good anti spyware program like spybot or superantispyware
What is the minimum and maximum value that a char type variable?
Character.MIN_VALUE = '\u0000' = 0
Character.MAX_VALUE = '\uFFFF' = 65535
How do you write a code in java script for follow the image with cursor?
<html>
<head>
<script language="javascript">
function f_follow(event)
{
temp.style.position="absolute";//this is necessary
temp.style.left=event.clientX;
temp.style.top=event.clientY;
}
</script>
<body onmousemove="f_do(event)">
<img src="....." id="temp"/>
</body>
</html>
Can an array contain elements of an object type?
Yes. An array of arrays is nothing more than a multi-dimensional array.
False. The square braces are the subscript operator. The subscript is the operand, the zero-based offset index that is passed to the operator.
Java solution
public static final int[] getMiddle(final int[] a, final int[] b) {
return new int[] {a[1], b[1]};
}
C solution void getMiddle(const int a[], const int b[], int ret[]) {
ret[0] = a[1];
ret[1] = b[1];
}
What is the difference between the final prospectuses 424B1 424B2 etc?
All are final prospectuses, just differ in the rule they are framed.
424B1 is based on Rule 424(b)(1) on Securities Exchange Act, 1934. Similarly the others.
Who is better quick sort or merge sort?
Statistically both MergeSort and QuickSort have the same average case time: O(nlog(n)); However there are various differences.
Most implementations of Mergesort, require additional scratch space, which could bash the performance. The pros of Mergesort are: it is a stable sort, and there is no worst-case scenario.
Quicksort is often implemented inplace thus saving the performance and memory by not creating extra storage space. However the performance falls on already sorted/almost sorted lists if the pivot is not randomized.
== ==
Why java do not support global variable declaration?
in order to acheive a inheritance and data encapsulation property global variables are not declared in java.
Can you write java program in Microsoft Word?
Since the Java program is basically a text file, you can write it in any text editor (although using a Java IDE, or an IDE with support for Java, does give you certain advantages).
Thus, you can use programs such as NotePad or NotePad++ to write the Java program. Using word processors such as MS-Word is problematic, because these insert additional codes. You would have to make sure you save the resulting file in the text format - give the "Save As" command, and choose a text format from the list.
Is 'Sonic the Hedegehog' an American creation or not?
No. Sonic is a Japanese creation. He had three 'parents'... * Artist Naoto Ōshima, * Designer Hirokazu Yasuhara, * Programmer Yuji Naka,
...all from the Sega company.
What method returns the uppercase equivalent of a string?
The toUpperCase() method returns the uppercase equivalent of a string.
What function is used to release the memory on heap?
The free() function releases memory obtained with the malloc() family of functions. The delete and delete [] operators release memory obtained with the new operator.
Note: realloc() can allocate and free memories as well as reallocate.