What will be the output of the program?
public class SortExample
{
public static void main(String [] args)
{
double value = -9.0;
System.out.println( Math.sgrt(value));
3
?
0 3.0
-3.0
O Nas
Answers
Answered by
5
Answer:
Difficulty level : Intermediate
Predict the output of following Java Programs.
Program 1 :
public class Calculator
{
int num = 100;
public void calc(int num) { this.num = num * 10; }
public void printNum() { System.out.println(num); }
public static void main(String[] args)
{
Calculator obj = new Calculator();
obj.calc(2);
obj.printNum();
Similar questions