Suppose there is an integer array holding following elements:
1,3,4,5,6,3,2,4,6,7,9,4,12,3,4,6,8,9,7,6,43,2,4,7,7,5,2,1,3,4,6,311,1
Write a program which prints which each number from array and...
Type: Posts; User: vinaysa86
Suppose there is an integer array holding following elements:
1,3,4,5,6,3,2,4,6,7,9,4,12,3,4,6,8,9,7,6,43,2,4,7,7,5,2,1,3,4,6,311,1
Write a program which prints which each number from array and...
public void sendMail()
{
int y = 300;
name = "Vinay";
age = 26;
sum();
sendMail(); // It is also recursive but not showing any error.
}
}
Please provide code for it.
public class Static_and_nonstatic {
String name;
static int age;
public static void main(String[] args)
{
age = 26;
sum();
}
public static void sum()
{
What is generateRandomNumber class ?
Please explain with example.
public class Utility1
{
public static void main(String[] args)
{
generateRandomNumber(100);
}
public static int generateRandomNumber(int n)
{
System.out.println(n);
return n;
I got it now.
Thanks !
string sum = a+b+c;
where a is string and b,c are integers.
Will it work then?
I want to display output a20.
What should be the code then?
If I put "a" instead of 'a', will it display a20.
public class Function2
{
public static void main(String[] args)
{
sumAll(10,20,30);
sumAll('a',10,10);
}
public static void sumAll(int a, int b, int c)
{
int sum = a+b+c;