learn java

Pronic Number Program in Java

A number is said to be a pronic number if product of two consecutive integers is equal to the number, is called a pronic number.
Example- 42 is said to be a pronic number, 42=6×7, here 6 and 7 are consecutive integers

Magic Number Program in Java

Magic number is the if the sum of its digits recursively are calculated till a single digit If the single digit is 1 then the number is a magic number. Magic number is very similar with Happy Number.

Prime Number Up to N Terms Program in Java

Prime Number Up to N Terms Program in Java. Ex: Enter size of prime=5
Number is prime=2
Number is prime=3
Number is prime=5
Number is prime=7
Number is prime=11
Number is prime=13

Mobike Program in Java

Define a class called Mobike with the following description:
Instance variables/data members:
String bno – to store the bike’s number(UP65AB1234)
String name – to store the name of the customer
int days – to store the number of days the bike is taken on rent
int charge – to calculate and store the rental charge
Member methods:
void input( ) – to input and store the detail of the customer.
void compute( ) – to compute the rental chargeThe rent for a mobike is charged on the following basis.
First five days Rs 500 per day;
Next five days Rs 400 per day
Rest of the days Rs 200 per day

void display ( ) – to display the details in the following format:
Bike No. PhoneNo. No. of days Charge

Object-Oriented Programming Concepts

If you’ve never used an object-oriented programming language before, you’ll need to learn a few basic concepts before you can begin writing any code. This lesson will introduce you to objects, classes, inheritance, interfaces, and packages. Each discussion focuses on how these concepts relate to the real world, while simultaneously providing an introduction to the syntax of the Java programming language.

Java Nested Class or Java Inner Classes

Objects that are instances of an inner class exist within an instance of the outer class.

How to Download and Install Java JDK

This Java Development Kit(JDK) allows you to code and run Java programs. It’s possible that you install multiple JDK versions on the same PC. But Its recommended that you install only latest version. Following are steps to install Java in Windows Step 1) Go to link. Click on Download JDK. For java latest version. Step […]

Pattern Space Pyramid Program in Java

Pattern Space Pyramid Program in Java

ASCII and Unicode

ASCII defines 128 characters, which map to the numbers 0–127. Unicode defines (less than) 221 characters, which, similarly, map to numbers 0–221 (though not all numbers are currently assigned, and some are reserved). Unicode is a superset of ASCII, and the numbers 0–127 have the same meaning in ASCII as they have in Unicode. For […]

Java Separators

In Java, there are a few characters that are used as separators. The most commonly used separator in Java is the semicolon. As you have seen, it is used to terminate statements. Symbol Name Purpose () Parentheses Used to contain lists of parameters in method definition and invocation.Also used for defining precedence in expressions, containing […]

1 2 3 4 5 13