A user defined package is a package outside of the standard Java libraries.
How many pre-built or predefined classes are there in JAVA?
In java 1.1 version 250 classes are there
java 1.2 version 500 classes are there
i don't about other versions. but i want to know other version classes also. please post any body known these other version classes list....
Is there any change by interchanging the position of main in Public static void main in java?
No. You can write it in as many ways as you want. The words public, static and void can be interchanged during the method declaration and still the main() method will continue to work in the same way.
i.e., public static void main(String[] args) is the same as static public void main(String[] args)
However, if you miss either of these 3 keywords from the method signature, the compiler will still let you compile the method, but it just won't be the main method that can be used to start the program execution.
Can you give an example of array program?
int main (int argc, char *argv[])
{
int i;
for (i=0; i<argc; ++i) printf ("%2d: %s\n", i, argv[i]);
return 0;
}
Java-find average using array?
public static final double getAverage(final int[] ns) {
if (ns.length == 0) {
return 0.0;
}
int sum = 0;
for (int n : ns) {
sum += n;
}
return ((double) sum) / ns.length;
}
Do you need to deallocate memory when an object is not in use?
Be more specific with your question:
Java: deallocation is always automatic
C++: objects allocated with new have to be released with delete
How do you get loop the loops in theme park ds?
when you get bonuses or when your making good money you put a bit of money in your ride research and say you put 1900 on it wait about 3-4 years and it should nearly be there if you are at the roller coaster
The ability to run your code which is written in a high level language without actually transforming into a different low level language based on the platform you are about to run. This is called portability.
Java is indeed known for this due to the fact that it runs on something called as an intermediate code called bytecode. JVM is the Java Virtual machine that reads the byte code and executes your application.
We can use any method. As we can find out the area of the circle by three methods as i known.
1.ordinary programming
e.g. void main() {
int r;float area;
printf("\n\tEnter radius of the circle : "); scanf("%d",&r); area=3.14*r*r; printf("Radius = %d and area=%f",r,area); } 2. By using macros e.g. #define PI 3.14
#define AREA(x) PI*x*x 3. We can solve by user defined functions also
Do you use an array when you only have two or three items to track?
Yes. Using an array when multiple elements need to be created at a time is always a better idea than declaring multiple variables. For ex:
Int i, j, k;
Int[] arr;
I have declared 3 int variables and another array just below it. Here since we are using only 3 variables, we can manage to use them without issues but if the number crosses 5 or even more then definitely using an array is always the best option.
What are the constructors are used to create an object of the file class?
There are three constructors that can be used to create a File class.
To create a new File object:
File newFile = new File("something");
How do you learn struts frame work?
To learn struts your self, you can get best documentation from Apache site
URL: http:/struts.apache.org
Struts 1 and Struts 2 are totally different API. Struts 1 is very famous. Right now lot of development community and teams are building applications using Struts 1.3. I feel it is better to learn Struts 1 in depth. and you can learn yourself struts 2 when it becomes popular.
For live examples, practice and quick learning better to take classes.
----
I know that Strategic Agile Technologies provides on-line java training. The trainings are really good. To learn Struts in depth you can take on-line course from them.
URL: http:/strategicagile.com/JavaTraining.aspx
This is not a question, it is an assignment.
class Geo {
public:
virtual double area (void) const = 0;
virtual ~Geo (void) {}
// ...
};
class Rect : public Geo {
private:
double m_width;
double m_height;
public:
Rect (double width, double height): m_width (width), m_height (height) {}
double area (void) const override { return m_width * m_height; }
~Rect (void) override {};
// ...
};
class Sqr : public Rect {
public:
Sqr (double width): Rect {width, width} {}
~Sqr (void) override {}
// ...
};
Writ evolution program ofInfix convert postfix without using classes or structures?
//made by vijay sahu
#include
#include
void main()
{
char p[20];
int stack[15];
int ts=-1,top=0;
int l=strlen(p);
cout<<" \n enter postfix expression";
cin>>p;
for(int i=0;i
{
if(p[i]>=48 && p[i]<=57)
stack[++ts]=p[i]-48;
else if(p[i]=='+' p[i]=='-' p[i]=='*' p[i]=='/')
{
int t1=stack[ts--];
int t2=stack[ts--];
switch(p[i])
{
case '+':
stack[++ts]=t1+t2;
break;
case '-':
stack[++ts]=t2-t1;
break;
case'*':
stack[++ts]=t1*t2;
break;
case '/':
stack[++ts]=t2/t1;
break;
}
}
}
cout<
}
How many types can write public static void main in java?
You can write it in as many ways as you want. The words public, static and void can be interchanged during the method declaration and still the main() method will continue to work in the same way.
i.e., public static void main(String[] args) is the same as static public void main(String[] args)
However, if you miss either of these 3 keywords from the method signature, the compiler will still let you compile the method, but it just won't be the main method that can be used to start the program execution.