Maruthi Krishna has Published 870 Articles

How to get (format) date and time from mill seconds in Java?

Maruthi Krishna

Maruthi Krishna

Updated on 07-Sep-2021 13:12:20

2K+ Views

The java.text.SimpleDateFormat class is used to format and parse a string to date and date to string.One of the constructors of this class accepts a String value representing the desired date format and creates SimpleDateFormat object.To format milli seconds to date −Create the format string as dd MMM yyyy HH:mm:ss:SSS Z.The ... Read More

What happens if we try to extend a final class in java?

Maruthi Krishna

Maruthi Krishna

Updated on 29-Jul-2021 14:12:54

2K+ Views

In Java final is the access modifier which can be used with a filed class and a method.When a method if final it cannot be overridden.When a variable is final its value cannot be modified further.When a class is finale it cannot be extended.Extending a final classWhen we try to ... Read More

Why can't we use the "super" keyword is in a static method in java?

Maruthi Krishna

Maruthi Krishna

Updated on 28-Jul-2021 14:43:59

4K+ Views

A static method or, block belongs to the class and these will be loaded into the memory along with the class. You can invoke static methods without creating an object. (using the class name as reference).Where the "super" keyword in Java is used as a reference to the object of ... Read More

How to create a Dialog in JavaFX?

Maruthi Krishna

Maruthi Krishna

Updated on 04-Jun-2021 06:10:21

10K+ Views

A Dialog is a graphical element, a window that shows information to the window and receives a response. You can create a dialog by instantiating the javafx.scene.control.Dialog class.ExampleThe following Example demonstrates the creation of a Dialog.import javafx.application.Application; import javafx.geometry.Insets; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.ButtonBar.ButtonData; import javafx.scene.control.ButtonType; import ... Read More

How to host a web-service using IIS (windows) and .net

Maruthi Krishna

Maruthi Krishna

Updated on 12-Feb-2021 11:11:22

6K+ Views

A web service is any piece of software which offers service to other systems. It makes itself available over the internet and uses a standardized XML or, JSON messaging system. A web service enables communication among various applications by using open standards such as HTML, XML, WSDL, and SOAP.IISIIS stands ... Read More

Can we override default methods in Java?

Maruthi Krishna

Maruthi Krishna

Updated on 08-Feb-2021 12:42:05

7K+ Views

An interface in Java is similar to class but, it contains only abstract methods and fields which are final and static.Since Java8 static methods and default methods are introduced in interfaces. Unlike other abstract methods these are the methods can have a default implementation. If you have default method in ... Read More

How to solve diamond problem using default methods in Java

Maruthi Krishna

Maruthi Krishna

Updated on 08-Feb-2021 11:53:31

15K+ Views

Inheritance is a relation between two classes where one class inherits the properties of the other class. This relation can be defined using the extends keyword as −public class A extends B{}The class which inherits the properties is known as sub class or, child class and the class whose properties are ... Read More

How to convert a super class variable into a sub class type in Java

Maruthi Krishna

Maruthi Krishna

Updated on 08-Feb-2021 11:52:56

10K+ Views

Inheritance is a relation between two classes where one class inherits the properties of the other class. This relation can be defined using the extends keyword as −public class A extends B{}The class which inherits the properties is known as sub class or, child class and the class whose properties are ... Read More

How to convert a sub class variable into a super class type in Java?

Maruthi Krishna

Maruthi Krishna

Updated on 08-Feb-2021 11:52:37

2K+ Views

Inheritance is a relation between two classes where one class inherits the properties of the other class. This relation can be defined using the extends keyword as −public class A extends B{}The class which inherits the properties is known as sub class or, child class and the class whose properties are ... Read More

Explain the usage of the valueOf() method of the String class in Java

Maruthi Krishna

Maruthi Krishna

Updated on 08-Feb-2021 11:36:43

196 Views

The String class of the java.lang package represents character strings. All string literals in Java programs, such as "abc", are implemented as instances of this class. Strings are constant, their values cannot be changed after they are created.The valueOf() method of the String class accepts a char or, char array ... Read More

Previous 1 ... 5 6 7 8 9 ... 87 Next
Advertisements