Answer the question
In order to leave comments, you need to log in
Main method not found in java?
package com.company;
public class QDemo2 {
static double rootof2;
static double rootof3;
static {
System.out.println("Внутри синтаксического блока QDemo2!");
rootof2 = Math.sqrt(2.0);
rootof3 = Math.sqrt(3.0);
}
QDemo2(String msg) {
System.out.println(msg);
}
}
class SDemo3{
public static void main(String[] args){
QDemo2 ob = new QDemo2("Внутри конструктора !");
System.out.println("Корень квадратныйй из 2 равен" + QDemo2.rootof2);
System.out.println("Корень из 3 " + QDemo2.rootof3);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question