Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Thursday, May 14, 2020

Data types in Java ?


Data Types in Java
  1. Primitive Data Type
  2. Non-Primitive Data Type

Primitive Data Type:–
  1. Integer type –
    • byte (Memory Capacity - 8 bit)
    • short (Memory Capacity -16 bit)
    • int (Memory Capacity  32 bit)
    • long (Memory Capacity - 64 bit)
  2. Floating point types
    • float – (Memory Capacity  32 bit)
    • double - (Memory Capacity - 64 bit)
  3. Character types
    • char (Memory Capacity -16 bit)
  4. Boolean
    • boolean – (can hold only two values- true or false)
Non-Primitive data types
  1. String
  2. Array
  3. Class etc



Sunday, May 03, 2020

How to run Java Programs

JDK (Java Development Kit) is the most important software which is required for compilation and run any java program. So JDK must be installed in your system to run any java program. Here we will learn how to download and install JDK in windows operating system. But before installing JDK make sure that JDK should not be installed in your system.

How to check whether JDK is installed or not in your system?

Go to control panel and click on uninstall a program, which will open all installed programs. Check that JDK is present or not in the list. If it is present in the list that means JDK is already installed in your system. So there is no need to install JDK in your system again.


Q. How to download and install the JDK in windows system.

Follow the below steps to download and install the JDK in your system.
Step1. 




First Simple Java Programm

1. The first simple java program is also known as "hello world" java program. The output of this program is to print "Hello world".
2. Below is the java program:
class MyClass
{
 public static void main(String args[])
 {
  System.out.println("Hello world");
 }
}
3. Brief description of this program. Here a class named MyClass is created, which contains a main() method.