Java questions

1) What are static blocks and static initalizers in Java ?

Static blocks or static initializers are used to initalize static fields in java. we declare static blocks when we want to intialize static fields in our class. Static blocks gets executed exactly once when the class is loaded

. Static blocks are executed even before the constructors are executed.

2) How to call one constructor from the other constructor ?

With in the same class if we want to call one constructor from other we use this() method. Based on the

number of parameters we pass appropriate this() method is called.

Restrictions for using this method :

1) this must be the first statement in the constructor

2)we cannot use two this() methods in the constructor

要查看或添加评论,请登录

Hasan Kocaman的更多文章

  • JDBC

    JDBC

    ? JDBC: Sun firmas?n?n ticari markas?d?r. ? Java Database Connectivity (Java Veritaban? Ba?lant?s?) ? JDBC, Java…

  • Java question 6

    Java question 6

    Difference between abstract class and interface ?

  • Postman using JavaScript

    Postman using JavaScript

    https://learning.postman.

  • Selenium - Advanced Browser Configuration

    Selenium - Advanced Browser Configuration

  • Selenium - Driver Initilization

    Selenium - Driver Initilization

  • Java Questions 5

    Java Questions 5

    Difference between method overloading and method overriding in java ?

  • git-github medium makale

    git-github medium makale

    https://www.mobilhanem.

  • API

    API

    Authentication who you are ehliyetimin on yuzu isim soy isim Autherization what you can do ehliyetin arkasi hangi…

  • Java questions 3-4

    Java questions 3-4

    3) What is method overriding in java ? If we have methods with same signature (same name, same signature, same return…

  • Jira'ya stepleri aktarmanin kolay yolu

    Jira'ya stepleri aktarmanin kolay yolu

    Excelden Jira'ya steplerinizi direk kopyalayabiliyorsunuz. Once testcase olusturun sonra add stepin yaninda importtaki…

    2 条评论

社区洞察

其他会员也浏览了