a=a+1; // Expression 1
a++; // Expression 2
a+=1; // Expression 3
++a; // Expression 4
A. | All expressions give the same result |
B. | 'Expression 2' is faster that 'Expression 3' which inturn is faster than 'Expression 1' |
C. | The value of 'a' after 'Expression 2' is different from 'Expression 4' |
D. | The value of 'a' after 'Expression 1' is same as 'Expression 3' |
class FeetToCMConversion
{ public static void main(String s[])
{
System.out.println(" 25 feet is same as " + convertToCentiMeter(25) + " cm");
}
public static double convertToCentiMeter(double feet)
{
double result = 0;
//Write code here to convert feet into centi meters and assign it to result
return result;
}
}
y = 4x^2 - 22x + 129; // x^2 is x square
class Function1
{ public static void main(String s[])
{
System.out.println("When x = 5, y is " + calculateY(5) );
}
public static int calculateY(int x)
{
int y = 0;
//Write code here to calculate the value of y for the given x.
return y;
}
}
class CelsiusToFahrenHeit
{ public static void main(String s[])
{
System.out.println("98.4 degrees fahrenheit is same as " + fahrenheitToCelsius(98.4) + " celsius");
System.out.println("100 degrees celsius is same as " + celsiusToFahrenheit(100) + " fahrenheit");
System.out.println("-40 degrees celsius is same as " + celsiusToFahrenheit(-40) + " fahrenheit");
}
public static double fahrenheitToCelsius(double fahrenheit)
{
double celsius = 0;
//Write code here to convert fahrenheit and assign it to celsius.
return celsius;
}
public static double celsiusToFahrenheit(double celsius)
{
double fahrenheit = 0;
//Write code here to convert celsius and assign it to fahrenheit.
return fahrenheit;
}
}
![]() |
+ (addition) |
![]() |
++ (increment) |
![]() |
* (multiplication) |
![]() |
- (minus) |
![]() |
() (parenthesis) |
![]() |
/ (division) |