Found 2616 Articles for Java

How to Instantiate an Abstract Class in Java?

Way2Class
Updated on 31-Jul-2023 17:50:13

523 Views

An Abstract Class is a class which is declared under the ‘Abstract’ keyword in Java. Abstract classes are a concept of one of the four principles of Object Oriented Programming (OOP) known as ‘Inheritance.’ Inheritance refers to a characteristic of Java Classes where one class known as the ‘Sub-class’ can inherit all the properties of the parent class typically known as ‘Super-class.’ In Java, Abstract Classes refer to the base super class from which other sub classes can inherit. It can contain both abstract and non-abstract methods. Algorithm Step 1 − Identify the methods in the class that have ... Read More

Drawing a Smiley in Java Applet

Way2Class
Updated on 31-Jul-2023 17:48:57

3K+ Views

Java Applet is an astounding resource that grants specialists to make smart representations and liveliness inside a web program. In this educational activity, we will examine how to draw a smiley face using Java Applet. We will cover the accentuation, little by little computation, and different ways of managing to accomplish this task. Close to the completion of this article, you will have an unquestionable understanding of how to make a smiley face using Java Applet. Syntax To draw a smiley face in Java Applet, we really want to utilize the Illustrations class, which gives techniques to draw different shapes ... Read More

DoubleUnaryOperator Interface in Java

Way2Class
Updated on 31-Jul-2023 17:34:59

64 Views

In the world of Java programming, interfaces assume an urgent part in characterizing gets that classes should stick to. One such interface point is the DoubleUnaryOperator interface, which was presented in Java 8 as a piece of the functional programming improvements. This interface point addresses a procedure on a single double-valued operand that delivers a double-valued result. In this article, we will explore the syntax, use, and different ways to deal with carrying out the DoubleUnaryOperator interface in Java. Syntax The syntax for the DoubleUnaryOperator interface is as per follows − @FunctionalInterface public interface DoubleUnaryOperator { double ... Read More

DoubleConsumer Interface in Java with Examples

Way2Class
Updated on 31-Jul-2023 17:32:00

73 Views

In Java, functional programming has acquired enormous fame because of its capacity to work on code and further develop code coherence. The DoubleConsumer interface point is a significant part of Java's functional programming worldview.It is a functional interface that accepts a double-valued argument and performs some operations on it. In this article, we will explore the syntax, usage, and examples of the DoubleConsumer interface in Java. Syntax The DoubleConsumer interface has a solitary conceptual strategy called accept, which takes a double value as its parameter. The syntax of the DoubleConsumer point of interface is as per the following: @FunctionalInterface ... Read More

Difference between Javabeans and Enterprise Javabeans

Way2Class
Updated on 31-Jul-2023 17:29:46

1K+ Views

In the domain of Java programming, Javabeans and Undertaking Javabeans (EJB) are two particular advances that fill various needs. While both assume an urgent part in Java improvement, it's fundamental to grasp their disparities and when to use each. This article aims to provide a comprehensive comparison between Javabeans and Enterprise Javabeans, exploring their syntax, approaches, and code examples. Approach To understand the difference between Javabeans and Enterprise Javabeans, it is essential to explore their approaches in Java development. Javabeans Javabeans are a lightweight and reusable component model used in Java programming. The approach with Javabeans involves creating modular, self-contained ... Read More

Difference Between java.sql.Time, java.sql.Timestamp, and java.sql.Date in Java

Way2Class
Updated on 31-Jul-2023 17:28:52

254 Views

In the world of Java programming, overseeing dates and times is a regular task. The java.sql group gives three classes - java.sql.Time, java.sql.Timestamp, and java.sql.Date - that are explicitly intended to manage various pieces of date and time control. Nonetheless, understanding the distinctions between these classes is urgent to guarantee precise treatment of worldly information in your Java applications. In this article, we will explore the nuances of each class and examine their remarkable functionalities. Approach While working with transient information, it is critical to pick the right class in light of the particular prerequisites of your application. Each ... Read More

Double floatValue() in Java with Examples

Way2Class
Updated on 31-Jul-2023 17:27:27

67 Views

When it comes to dealing with precision-based calculations, Java provides a myriad of tools and functions. One such functionality is the handling of floating-point numbers, particularly with the Double and Float wrapper classes. Today, we are going to unravel the mysteries around the Double and Float Value() method in Java. Syntax The Value() function in the Double and Float classes in Java is defined as follows: public double doubleValue() public float floatValue() Explanation of Syntax These techniques are a piece of the Twofold and Float covering classes. The doubleValue() technique changes over the Twofold item into a twofold crude, ... Read More

Count occurrence of a given character in a string using Stream API in Java

Sonal Meenu Singh
Updated on 31-Jul-2023 19:47:33

5K+ Views

Introduction In this tutorial, we will implement an approach that counts how many times a particular character appears in a string using the Stream API in Java. A string is a collection of characters and we will use a String class method to separate string characters. We will take an input string and define a character we want to count. The functions used in this approach are the chars() method of the String class and the filter() method of the Stream interface. char() = It is a String class instance method. It returns the intstream values. The stream contains ... Read More

Difference Between Java And Ruby

Way2Class
Updated on 31-Jul-2023 17:26:50

98 Views

Java and Ruby are two strong, significant level programming dialects broadly utilized in the tech world today. Java, an arranged language made by Sun Microsystems during the '90s, has a post in huge business level applications. Ruby, a dynamic, unraveled, open-source language made by Yukihiro "Matz" Matsumoto in Japan, is striking for its elegance and conceivability, especially found in the Ruby on Rails structure. This article will jump into the intricacies of their sentence structure, estimations, and different ways of managing programming tasks. Syntax The syntax of a programming language refers to the set of rules defining how programs written ... Read More

Difference between Java and PHP

Way2Class
Updated on 31-Jul-2023 17:24:24

147 Views

In the grand spectacle of software development, various actors grace the stage, none more distinctive than Java and PHP. As different as they may be, they both have brought about significant innovations in the digital realm. It is the contrast between their characteristics that lends to their unique appeal and utility. This discourse aims to illuminate the key differences between these two prominent languages, analyzing their syntax, algorithms, and some of their most common approaches. Syntax The syntax of a language, much like the grammar in human linguistics, forms its backbone, defining the structure and rules of communication. Java, a ... Read More

Advertisements