Discuss final method and final classes?
a method declared final can not be overridden, and a class declared as final can not be extended by its sub class.
When should you use static method and when should we use instance method?
Non-static methods are the "normal" type of methods for a class to have. They use instance variables to perform certain actions. In other words, object A and object B of the same class may behave differently when we call one of their Non-static methods depending on the value of their instance variables. Static methods on the other hand behave the exact same way for all instances of a class. object A and B of the same class will act in the same way when we call one of their Static methods. (*NOTE* Static methods cannot use instance variables)
final double[] ns = new double[10];
final Random rnd = new Random(System.currentTimeMillis());
// Fill...
for (int i = 0; i < ns.length; ++i) {
ns[i] = rnd.nextDouble();
}
// Get largest/smallest...
double largest = Double.MIN_VALUE;
double smallest = Double.MAX_VALUE;
for (double n : ns) {
if (n > largest) {
largest = n;
}
if (n < smallest) {
smallest = n;
}
}
// largest and smallest are now the proper values.
What are the types of variables?
THE TYPES OF VARIABLES
1.Constant or Controlling Variables
2.Manipulated Variable
3.Responding Variable
What is the prototype of a copy constructor for a class X?
class X { public: X(); // default constructor X(const X& x); // copy constructor // ... }; int main(void) { X objx1; //normal ctor X objx2 = x1; // copy ctor X x3(x2); // copy ctor }
How is a constructor in the super class called?
By using the reference super();
When you invoke super(); the JVM knows that you are trying to invoke the constructor from the parent class and calls the super class constructor automatically. In fact, the invocation to super(); is usually the first line of any class constructor. This is done to ensure that all the parent class objects are initialized before the current child class is created.
What is meant by a 'concrete command'?
It means that you have to do it now. So if someone tells you a concrete command you better do it
Maximum client for odbc connection?
Maximum client is the maximum number of requests that can be served by webserver at a time.
Is special symbols are valid as a string in java?
Yes. Any special character inside the String is considered as part of the string variable and would not be treated as a special character.
Ex:
String str = "ABC_$4";
is a valid string declaration
How do you Send arrays to function?
Simply by sending the base address from main() and catching that in a pointer in the pointer.
void main()
{ int a[20];
sort(a);
}
void fun(int *p)
{
}
int *ptr = (int *) calloc(10,sizeof(int));
Can userdefined exception have two methods in it?
Yes a user defined exception can have any number of methods in it.
A user defined exception is nothing but a Java class created for a specific purpose. Just like ordinary Java classes, you can have any number of methods in it...
The routing protocol also specifies how routers in a network share information with each other and report changes. The routing protocol enables a network to make dynamic adjustments to its conditions, so routing decisions do not have to be predetermined and static.
How is it possible that the same Java program can run on different platforms?
Java source code is compiled into .class files, which are used by the Java Virtual Machine (JVM). The format of the .class file is the same for all platforms, and so the source code can be compiled the same way on each platform. The JVM, however, needs to be written to run on a specific platform. This is the part which converts Java bytecode to native bytecode, and is why you need to download the JRE (which contains the JVM) for a specific platform. Java source code is compiled into .class files, which are used by the Java Virtual Machine (JVM). The format of the .class file is the same for all platforms, and so the source code can be compiled the same way on each platform. The JVM, however, needs to be written to run on a specific platform. This is the part which converts Java bytecode to native bytecode, and is why you need to download the JRE (which contains the JVM) for a specific platform.
From which website can you learn JAVA for free?
There is an enormous amount of free information available for this language. A search in Google for the keywords Java tutorials gives over 15 million hits. The first hit - java.sun.com/docs/books/tutorial/ - is quite good, at least for a start. Note that Sun is the creator of the Java language. But I found that it advances too quickly on some topics, so (after going through the first, introductory, chapters), you may want to search for additional sources of information.
Be sure to:
Be sure to:
Be sure to:
Be sure to:
How do you get the proper division in java?
import java.io.*;
public class ProperDivision
{
public static void main (String [] args) throws IOException
{
BufferedReader value = new BufferedReader (new InputStreamReader(System.in));
int n;
int sum;
int divisor;
String input;
System.out.print("Enter an integer:");
n = Integer.parseInt(value.readLine());
for(n=1;n==n;n++);
System.out.println("The proper divisor of "+ n + " are");
}
}
SILAR - SUCCESSIVE IONIC LAYER ABSORPTION AND REACTION is a low temperature and solution based process that can deposit atomic layers one layer at a time. The traditional SILAR cycle for a substrate is
Dip in Cation precursor solution
Rinse with distilled water
Dip in Anion solution
Rinse with distilled water
To break something down with specific details.Like if you want ice cream you have to specify what kind of ice cream you would like.
Write a program to create a thread by extending the thread class?
import java.util.Random;
class ExampleThread extends Thread {
private static final Random rnd = new Random();
public ExampleThread(String str) {
super(str);
}
public void run() {
for (int i = 0; i < 10; i++) {
System.out.println(i + " " + getName());
try {
sleep(rnd.nextInt(1000));
} catch (InterruptedException e) {}
}
System.out.println("Thread is: " + getName());
}
}
How to write java program for FLAMES game?
for (int i = 0;i < nme.length() ;i++ ) { n[i] = nme.charAt(i); } for (int j=0;j < lnme.length() ;j++ ) { l[j] = lnme.charAt(j); } for (int i = 0;i < nme.length() ;i++ ) { for (int j=0;j < lnme.length() ;j++ ){ if(n[i] == l[j]){ n[i] = ' '; l[j]=' '; } } } int C = 0; for (int i = 0;i < nme.length() ;i++ ) { if(n[i] != ' ' ){ C ++; } } for (int j=0;j < lnme.length() ;j++ ) { if(l[j] != ' ' ){ C ++; } }
refer this site for full coding: http://shamjeet.blogspot.in/p/java-se.html#c
An equivalence relation ~ on A partitions into pairwise disjoint subsets called equivalence classes so that 1. Within each class, every pair relates 2. Between classes there is no relation i.e. [x] = {a (element) A | a~x} and given two equivalence classes [a] and [b], either [a] = [b] or [a] intersect [b] = the empty set
An array is when you store several data items with a single name. You only use a number to distinguish the individual items. Or two or more numbers, if you use a multidimensional array.
An array is when you store several data items with a single name. You only use a number to distinguish the individual items. Or two or more numbers, if you use a multidimensional array.
An array is when you store several data items with a single name. You only use a number to distinguish the individual items. Or two or more numbers, if you use a multidimensional array.
An array is when you store several data items with a single name. You only use a number to distinguish the individual items. Or two or more numbers, if you use a multidimensional array.
In java difference between classes and object in tabluar form?
A class is a template to create objects. You define the general behavior of a new data type in a class; then you create objects as specific variables of the new type. In other words, you can consider the class as a data type.
A class is a template to create objects. You define the general behavior of a new data type in a class; then you create objects as specific variables of the new type. In other words, you can consider the class as a data type.
A class is a template to create objects. You define the general behavior of a new data type in a class; then you create objects as specific variables of the new type. In other words, you can consider the class as a data type.
A class is a template to create objects. You define the general behavior of a new data type in a class; then you create objects as specific variables of the new type. In other words, you can consider the class as a data type.
I dont know how to generate the nos. randomly.I think it should follow some logic.So the following prog is made upon the inputs given by a user.
#include
#include
void main()
{ int a[5][5],i,j,s;
printf("\nEnter elements of the 5X5 matrics:\n");
for(i=0;i<5;i++)
{ for(j=0;j<5;j++)
{ scanf("%d",&a[i][j]);
if(a[i][j]<0 a[i][j]>100)
{ printf("\nThe no. should be between 1 & 100\nEnter Again:");
scanf("%d",&a[i][j]);
}
}
}
printf("\nThe given matrix is:\n");
for(i=0;i<5;i++)
{ for(j=0;j<5;j++)
printf("%d",a[i][j]);
printtf("\n");
}
printf("\nThe sum of each row:");
for(i=0;i<5;i++)
{ for(j=0;j<5;j++)
s+=a[i][j];
printf("%d->%d\n",i+1,s);
}
getch();
}
Hope this would help you.