Computer Science, asked by nannu1127, 5 hours ago

class Sample{private double num = 100;private int square(int a){return a*a;}}public class Test{public static void main(String argsl){Sample obj = new Sample();System.out.println(obj.num);System.out.println(obj.square(10));}}Select one:a 100b. Run time errorc. Executes but no outputd. Compile time error​

Answers

Answered by jayatidsvaidya
0

Answer:

import java.util.Date;

class Sample{  

  private double num = 100;

  private int square(int a){

return a*a;

  }

}  

public class Test{

  public static void main(String args[]){  

Sample obj = new Sample();  

System.out.println(obj.num);

System.out.println(obj.square(10));

  }  

}

Explanation: Java is a very popular general-purpose programming language, it is class-based and object-oriented. Java was developed by James Gosling at Sun Microsystems ( later acquired by Oracle) the initial release of Java was in 1995. Java 11 is the latest long-term supported version (LTS). As of today, Java is the world's number one server programming language with a 12 million developer community, 5 million students studying worldwide and it's #1 choice for cloud development.

hope its ok

Answered by nsaikrishna27
1

Answer:

Compile time error is the correct answer.

Explanation:

Similar questions