Compile Time: In longer form, you might say, "at the time of compiling", or, "when the program is compiled".
When you compile a program, the compiler applies various processes to your source code in order to generate the executable files. These are actions that happen "at compile time".
Other actions happen when you actually run the finished program. These actions are said to occur, at, or in, "run time".
Why is java is neutral platform independent?
Java solves the problem of platform-independence by using
byte code. The Java compiler does not produce native
executable code for a particular machine like a C compiler
would. Instead it produces a special format called byte
code. Java byte code written in hexadecimal, byte by byte,
looks like this:
CA FE BA BE 00 03 00 2D 00 3E 08 00 3B 08 00 01 08 00 20 08
This looks a lot like machine language, but unlike machine
language Java byte code is exactly the same on every
platform. This byte code fragment means the same thing on a
Solaris workstation as it does on a Macintosh PowerBook.
Java programs that have been compiled into byte code still
need an interpreter to execute them on any given platform.
The interpreter reads the byte code and translates it into
the native language of the host machine on the fly. The most
common such interpreter is Sun's program java (with a little
j). Since the byte code is completely platform independent,
only the interpreter and a few native libraries need to be
ported to get Java to run on a new computer or operating
system. The rest of the runtime environment including the
compiler and most of the class libraries are written in Java.
All these pieces, the javac compiler, the java interpreter,
the Java programming language, and more are collectively
referred to as Java.
What is concrete class in java?
A method which is not abstract i.e. if a methods definition is given in the same class its declared is called concrete. where as abstract method would have no definition till the deep down of the hierarchy of class structure but ll ve a declaration in all the subclasses and definition in one subclass after which it need not be declared in the further subclasses. By the way defining the abstract method in a subclass would end the carrying of the declaration till down, but defining it is not mandatory where declaring is mandatory.
How does a function differ from a procedure?
In closed subroutine a subroutine stored outside the main routine can be connected to it by linkages at one or more locations.
whereas in open subroutine is a set of computer instructions i.e. a subroutine that performs some particular program and insert them directly each and every time that particular function is required
Explain classes of java.lang package?
The lang package contains classes for data types like Boolean, String etc and also some other classes like Thread.
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/package-summary.html
Refer this for complete details.
Difference Between interpreter and compiler in java application?
Due to platform independence, a Java compiler will interpret Java source code into Java Byte Code and pass to the JVM, which will pass machine understandable code through to cpu. (clarification needed).A conventional compiler converts source code directly to machine code.(clarification needed).
Disadvanatges of object-oriented programming languages?
Why c is preferred over Java for embedded system?
Embedded systems typically run on extremely limited hardware. Even the smallest implementation of Java (Micro Edition) can't compete with a small C implementation both in terms of memory footprint and execution speed.
import java.io.*;
class summ
{
public static void main()throws IOException
{
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
int a[]=new int[10];
int sum=0;
float avg=0;
for(int i=0;i<10;i++)
{
System.out.println("Enter marks of student "+(i+1)+" : ");
a[i]=Integer.parseInt(in.readLine());
sum+=a[i];
avg=sum;
}
avg/=10;
System.out.print("Sum= "+sum+"\nAverage= "+avg);
}
}
Is 'k equals k plus 1' same as 'k plus equals 1' in Java?
Yes, they are exactly the same, both of them increment k in 1.
class BackString
{
public static void main(String[] args)
{
//work out the length of args[]
int len=args.length;
//cycle forwards through the array string
for (int i=0; i<len; i++)
{
//how long is the word in characters?
int wordLen = args[i].length();
//cycle backwards through the word a char at a time
for (int j=wordLen-1; j>=0; j--)
{
System.out.print(args[i].charAt(j));
}
System.out.print(" ");
}
}
}
What is the major difference in class and interface in c?
The implementation detail. Classes may provide a default implementation, interfaces provide only the method signatures
Compiling is the act of translating human-readable source code to machine-readable byte code.
In Java, the compiler program is javac
Program for doing upercase of 1st letter of string?
#include<stdio.h>
#include<conio.h>
#include<ctype.h>
main()
{
char string[80];
int n,k=0;
clrscr();
while((string[k]=getche())!='\r')
k++;
string[k]='\0';
n=k;
k=0;
while(k<n)
{
putchar(toupper(string[k]));
k++;
}
}
Algorithm for infix to prefix conversion?
Algorithm to Convert Infix to Prefix Form
Suppose A is an arithmetic expression written in infix form. The algorithm finds equivalent prefix expression B.
Step 1. Push ")" onto STACK, and add "(" to end of the A
Step 2. Scan A from right to left and repeat step 3 to 6 for each element of A until the STACK is empty
Step 3. If an operand is encountered add it to B
Step 4. If a right parenthesis is encountered push it onto STACK
Step 5. If an operator is encountered then:
a. Repeatedly pop from STACK and add to B each operator (on the top of STACK) which has same or higher precedence than the operator.
b. Add operator to STACK
Step 6. If left parenthesis is encontered then
a. Repeatedly pop from the STACK and add to B (each operator on top of stack until a left parenthesis is encounterd)
b. Remove the left parenthesis
Step 7. Exit
How do you get a default constructor?
The default constructor is an empty (only call the super constructor) with no parameters constructor inserted by the java compiler when you don't define a constructor in your class. If you write something like this:
public class NoConstructorClass{
//no constructor goes here
}
Then you get something like this:
public class NoConstructorClass{
public NoConstructorClass(){ // Default constructor that you didn't write
super();
}
}
What is a default package in Java?
A default package is a package with no name. You can create a Java class without putting package name on top of the code. This class is included in the "default package".
Be careful not to be confused with java.lang, which is a package that contains Java's fundamental classes and get's imported by default.
Download JRE 1.5.0 09 for Vista?
You can download the Sun Java JRE Version 1.5.0_09 Here: http://java.sun.com/products/archive/j2se/5.0_09/index.html
or various kinds of the above, such as
or various related concepts:
or also:
What is it called when java allows you to declare methods with the same name in a class?
Yes perfectly Legal
Reason:
The scope of a variable declared inside a method is only till the method's end. So by defining another variable of the same name inside a different method does not create any issues.
Why do you need runnable interface?
A Runnable Interface is one that is used to create a Java Thread...
A Thread can be created in two ways and using the Runnable Interface is one of them.
Example:
public class Test implements Runnable {
public void run(){
....
}
}
The Runnable interface would have an abstract instance of the method run() which needs to be implemented in the class which wants to create a Thread.
What is the difference between a constant and a variable in java programming language?
A constant in Java is defined using the "final" modifier. For instance:
final double Density_Of_Water = 1.000;
would set Density_Of_Water to 1.000. This value can not be modified throughout the program because "final" told the compiler that this value would not change. A variable however, can be changed by the user throughout the program.
How do you find the greatest of two numbers without using the if-else comparison operators?
By subtracting any two of the numbers A-B , if the output number is negative , B IS GREAT and if its positive A is great