when a website or something says java disabled it means. That you dont have a surtain download so if you go onto, the java website you can download it for free!! :)
What are source language issues in run time environment?
The allocation of data objects is managed by the run-time support package, consisting of routines loaded with the generated target code. The design of run-time support package is influenced by the semantics of procedures. Each execution of the procedure is referred to as an activation of the procedure. If the procedure is recursive several of its activations may be alive at the same time.
Source Language IssuesProceduresA procedure definition is a declaration that, in its simplest form, associates an identifier with a statement. The identifier is the procedure name, and the statement is the procedure body. Procedures that return values are called function in many languages; however, it is convenient to refer them as procedures. A complete will also be treated as a procedure.When a procedure name appears within an executable statement, we say that the procedure is called at that point. The basic idea is that a procedure call executes the procedure body.
Some of the identifiers appearing in a procedure definition are special, and are called formal parameters (or just formals) of the procedure. Arguments known as actual parameters may be passed to a called procedure they are substituted for the formals in the body.
Activation TreesWe make the following assumptions about the flow of control among procedure during the execution of a program:
Each execution of a procedure body is referred to as an activation of the procedure. The lifetime of an activation of a procedure p is the sequence of steps between the first and last steps in the execution of the procedure called by them and so on. In general the term "lifetime" refers to a consecutive sequence of steps during the execution of a program.
If a, b are procedure then their lifetimes are either non-overlapping or are nested. That is if b is entered before a, is left then control must leave b before it leaves a. this nested property of activation lifetime can be illustrated by inserting two print statements in each procedure one before the first statement of the procedure body and the other after the last. The first statement prints enter followed by the name of the procedure and the values of the actual parameters; the last statement prints leave followed by the same information.
A procedure is recursive if a new activation can begin before an earlier activation of the same procedure has ended. A recursive procedure need not call itself directly; p may call another procedure q, which may then call p through some sequence of procedure calls. We can use tree, called an activation tree, to depict the way control enters and leaves activations. In an activation tree,
1. Each node represents an activation of a procedure,
2. The root represents the activation of the main program,
3. The node for a is the parent of the node for b if and only if the control flows from activation a to b, and
4. The node for a, is to the left of the node for b if and only if the lifetime of a, occurs before the lifetime of b.
Since each node represents a unique activation and vice versa it is convenient to talk of control being at a node it is in the activation represented by the node.
Control Stacksthe flow of control in a program corresponds to a depth-first traversal of the activation tree that starts at the root ,visits a node before its children, and recursively visits children at each node left to right order. the output in fig 7.2 can therefore be reconstructed by traversing the activation tree in fig7.3,printing enter when the node for an activation is reaches for the first time and printing leave after the entire sub tree of the node has been visited during the traversal.
We can use a stack, called a control stack to keep track of live procedure activations. The idea is to push the node for activation onto the control stack as the activation begins and to pop the node when the activation ends.
Then the contents of the control stack are related to the paths to the root f the activation tree. When the node n is at the top of the control stack, the stack contains the nodes along the path from n to the root.
Example 7.2:fig 7.4 shows nodes from the activation tree of fig 7.3 that that have been reached when control enters the activation represented by q(2,3).Activations with labels r, p(1,9),p(1.3),and q(1,0) have executed to completion, so the figure contains dashed lines to their nodes. The solid lines mark the path from q (2, 3) to the root.
At this point the control stack contains the following nodes along this path to the root (the top of the stack is to the right)
s, q(1,9),q(1,3),q(2,3) and the other nodes.
The Scope of a Declaration
A declaration in a language is a syntactic construct that associates information with a name. Declarations may be explicit, as in the Pascal fragment
Var i : integer;
Or they may be explicit. For example, any variable name starting with I is or assumed to denote an integer in a FORTRAN program unless otherwise declared.
There may be independent declarations of the same name in the different parts of the program. The scope rules of a language determine which declaration of a name applies when the name appears in the text of a program. In the Pascal program in fig 7.1, i am declared thrice, on lines 4, 9 and 13, and the users of the name i in procedures read array, partition and quick sort are independent of each other. The declaration on line 4 applies to uses of i on line 6.tht is, the two occurrences of i on the line 6 are in the scope of the
The portion of the program to which a declaration applies is called the scope of the declaration applies is called the scope of the declaration .An occurrence of a name in a procedure is called to be local to the procedure if it is the scope of a declaration within the procedure; otherwise, the occurrence is said to be non-local.
The distinction between local and the non-local names carries over to any syntactic construct that can have declarations within it.
While the scope is a property of the declaration of a name, it is sometimes convenient to use the abbreviation "the scope of a name x" for "the scope of the declaration of name x that applies to this occurrence of x". In this sense, the scope of ion line 17 in fig7.1 is the body of quick sort. At compile time, the symbol table can be to find the declaration that applies to an occurrence of a name. When a declaration is seen, a symbol table entry is created for it. As long as we are in the scope of the declaration, its entry is returned when the name in it is looked up. Symbol tables are discussed in section 7.6a
It means that something can be changed after it is created. Immutable means that it can't be changed.
What is a garbage collector called?
In Java it is called by the same name "Garbage Collector"
The purpose of the garbage collector to free up unused heap space so that it can be utilized by the other programs. All unused objects are cleared using the GC to create space for other applications/programs.
What keyword is used to invoke user-defined exceptions?
throw is the keyword used to invoke the exception.
throw new NoBalanceException("No balance please");
I changed the time while playing a pogo game. Now it pops up during the game_"please do not change the time while playing".
How can I fix it?
What do you mean by data types?
Data type refers to the kind of data a variable in any programming language can hold.
For example int is used to store integer numeric values. A String is used to hold alpha numeric values.
int i = 10;
String name = "Rocky";
etc.
Each data type has its own characteristics and size.
Which Interfaces are used by implementations of models for JTable?
JTable has three models:
TableModel, TableColumnModel, and ListSelectionModel.
check this first page:
www.grandt.com/sbe/files/uts2/Chapter18.doc
Write a program to print automorphic numbers between 1 and 100?
import java.math.*;
import java.util.*;
class AutomorphicNumber{
static int d=10;
public static void main(String args[]){
System.out.print("Enter any number :");
Scanner input=new Scanner(System.in);
int n=input.nextInt();
if(d>=n){
if ((n*n) % d == n){
System.out.println("Automorphic Number");
}
else{
System.out.println("Not Automorphic Number");
}
}
else if(d<=n){
d=d*10;
if ((n*n) %d==n){
System.out.println("Automorphic Number");
}
else{
System.out.println("not an automorphic number");
}
}
}
}
Why does BlueJ give number format exception?
A NumberFormatException is used to show that you've attempted to convert a String to a number, but the String was not formatted correctly.
Examples:
// This line is perfectly valid, since "123" represents a number.
int a = Integer.parseInt("123");
// This line will throw a NumberFormatException, since "123abc" is not a number.
int b = Integer.parseInt("123abc");
How good is java random number generator?
I don't what you mean by good, but I have tested it and it creates a normal distribution also known as Gaussian.
What fields use the stata program package frequently?
Stata, a statistical software package, is a general-use program. It is frequently used by researchers for studies in economics, political science, epidemiology.
What does the or mean in java?
That's the boolean "or" operator. It calculates a result based on two boolean values. The result is false if both starting values are false; in all other cases, the result is true.
What is voluntary constraints?
A voluntary constraint is when a company voluntary says they will never do this or they will always do that, an example of this would be always recycling there used materials or just paying there employees a higher than minimum wage, these things do not have to be done but yet they do they do them anyway to give them a better reputation with the public.
Does the C plus plus programming language use a virtual machine?
No, it does not. But Microsoft Visual Studio 2008 allows you to connect to a virtual machine and run your projects "sandboxed".
How are data and method organised in object-oriented program Illustrate the same for car object?
For example, given a base class of "Car," polymorphism enables the programmer to define different "StartEngine" methods for any number of derived classes. The "StartEngine" method of a derived class named "DieselCar" may be completely different from the method with the same name in the base class.
What is the top most class in Exceptions?
All exception types are sub classes of the built-in class Throwable.
so at the top most position it is Throwable --- under this comes two branches Exception and Error.
Why Session Factory is thread safe in hibernate?
SessionFactory is Hibernates concept of a single datastore and is threadsafe so that many threads can access it concurrently and request for sessions and immutable cache of compiled mappings for a single database. A SessionFactory is usually only built once at startup. SessionFactory should be wrapped in some kind of singleton so that it can be easily accessed in an application code.
SessionFactory sessionFactory = new Configuration().configure().buildSessionfactory();
Which language is 100 percent pure object oriented language?
The languages C# and Ruby are notable for their pure object oriented design. You can even call instance functions on literals, such as 10.to_s (Ruby) or 10.ToString() (C#). Other object-oriented designs tend to treat primitives as non-objects, such as in Java, and are therefore not technically "100%" object-oriented.
How do i use java to create or write in txt files?
// to create a new file
File f = new File("newfile.txt");
f.createNewFile();
// to write a string to a file
String str = "This text will appear in newfile.txt\nThis, too.";
// create our writer object
BufferedWriter out = new BufferedWriter(new FileWriter(f));
// write str to f
out.write(str);
// remember to flush the buffer and close the writer
out.flush();
out.close();
What are the coding standards used in java to name a class?
To name a class, you simply need an access specifier, sometimes the word "static" or "abstract" (only if applicable), the word "class", and a class name. The body of the class is then contained in brackets. Example:
public class Empty{}
"public" is the access specifier (public is also default, and thus really unnecessary), and "Empty" is the class name. It is common to capitalize the first letter of the class name, as well as the first letter of each word if the name is made of several words concatenated together.
Would you explain diff between int and integer?
In Java, int is a primitive data type that is used to hold numeric values. for example an int variable can be used to hold your age in a Java program.
Integer is the Wrapper class for the int data type. In Java there are a lot of in built features that work only on objects. under such circumstances we can wrap the primitive data type in its wrapper and use it.
For example:
int x = 10;
Integer xObj = newInteger(x);
if you want to know the value contained in xObj, then we use the method intValue().
xObj.intValue() would return the value 10 contained in it.