Home / JAVA (page 2)

JAVA

Java Program to find Anagrams Words

Anagrams Program in Java: Anagrams means different combination, the result of rearranging the letters of a word to produce new words or we can say the possible string we make by rearranging the letter of word. Anagrams of a word is to get all the permutation of a word. Here we have provided a simple anagram code in Java and there are ...

Read More »

Harshad Number Program in Java (Niven Numbers)

Java Program to check for Harshad Number:  What is a Harshad Number? Harshad Number also called Niven Number is a number that is divisible by the sum of its digits. Example: Number 200 is a Harshad Number because sum of digits 2 and 0 and 0 is 2(2+0+0) and 200 is divisible by 2. Number 171 is a Harshad Number because ...

Read More »

Ugly Numbers Algorithm – C and Java Program

C Program / Algorithm for Ugly Numbers:  What is an Ugly Number Series? Ugly Numbers are the ones whose prime factors are 2,3 or 5 Only. We have also given a Java Source code in Method #4 So Ugly Number Series is 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, and so on… The reason why 1 is added is because ...

Read More »

Convert Writer to String in Java

Here is the Java Program for Writer to String Conversion : If you want to convert writer to string java here is the example for StringWriter Stream that is to be imported from the package Java.io. Here we are using append function.   OUTPUT Welcome to Getprogramcode.com

Read More »

How to use final keyword in Java

Many queries related how to use final keyword came across. In java we can use final keyword in three ways: 1-Declare the class as final. 2-Declare the method as final 3-Declare the variables as final.

Read More »

library classes and library functions in Java

What are library classes and library functions in Java Library Classes:- These are the predefined classes provided by Java system present in packages. These classes contain related library functions like String Math, etc. All the library classes belong to some package. Library Functions:- These are the inbuilt functions present in Java library classes, provided by Java system to help programmers to perform ...

Read More »

Java program to use super keyword

Super is a keyword which refers to reference of base class. Super is used to call any constructor or any method of base class but it must be 1st line of the derived class constructor. We use the super keyword in java for two purposes: 1-      Super keyword for calling base class constructor. 2-      Super keyword for calling base class ...

Read More »

Static keyword in java

Static keyword is often used in java for various purpose. Different programmers use different keyword according to their convenience and requirement However one could not move away from the fact that static keyword is frequently used in Java.projects We can use “static” in java in three ways: 1. static method 2. static variables 3. static block    

Read More »

Abstract class and abstract method in Java

This tutorial is to tell you about the abstract class and the abstract method in Java  Abstract Class :- A class which cannot be instantiated i.e object cannot be created only is called Abstract class. In other words ,we can say that only we can inherit the abstract class but we cannot create the object of this class to execute ...

Read More »

Basic concepts of Java: Quick Revision

Here is the Quick Revision for those who have to clear their concepts of Java in few Minutes. Java is Object Oriented programming language which was developed at Sun Micro systems. By object-oriented we mean, it is a technique to develop logical modules, such as classes that contain properties, methods, fields and events. An object is created in the program to ...

Read More »