InstructorPriyanka Pandey
TypeOnline Course
Student Enrolled3
Price₹99
Buy NowBook Now

Prominent Features

Our online courses offer a quality learning experience, convenience, and flexibility and are delivered through our online course management system. Using this supportive, user-friendly course environment you can make learning fun.

Twitter Feed

Blog Updates

Top 50 Engineering Colleges of India – 2017
IC Fabrication Process
Indian Institute of Technology Bombay

It would not be any wrong to call Java a winner in the world of programming languages. From web to mobile, electronic appliances to servers, Java is used everywhere. If you are dreaming of a rewarding career in IT, the expertise in JAVA is an essential skill to have. This course is perfect for anyone who wants to start a career in this field and has no prior programming experience. You will create conditional statements, functions, and loops to process information and solve problems. Learn everything about Object-oriented programming in Java.

What You Will Learn

What are you going to learn

Build strong foundations in Java programming. Learn object-oriented programming in Java. Create conditional statements, functions,and loops to process information and solve problems. Work on Java projects using objects and classes.

  • Introduction to Java syntax

    Discover the basic idea behind programing and write your first Java program. Use variables to store and retrieve information.

  • Conditional statements, functions and loops

    Use if-else statements and switch-case statements to write Java programs to tackle any decision making scenario. Create functions in Java. Declare methods with input arguments and return types. Then, call the functions you create. Use for and while loops to iterate over a block of code. Learn how to write nested loops. Use 2D arrays to store and retrieve information.

    Object-oriented programming in Java

    Learn all about Object Oriented Programming (OOP) and how to create an entire Java project using objects and classes.

Section 1An introduction to JAVA languageFree Preview

Welcome to Java!

Java is a high level, modern programming language designed in the early 1990s by Sun Microsystems, and currently owned by Oracle.

Platform Independent

Java is Platform Independent, which means that you only need to write the program once to be able to run it on a number of different platforms!
Java is portable, robust, and dynamic, with the ability to fit the needs of virtually any type of application.
Get JAVA

Java guarantees that you’ll be able to Write Once, Run Anywhere.

Java

More than 3 billion devices run Java.
Java is used to develop apps for Google’s Android OS, various Desktop Applications, such as media players, antivirus programs, Web Applications, Enterprise Applications (i.e. banking), and many more!

Section 2DATA TYPES IN JAVAFree Preview

Data types in Java

There are majorly two types of languages. First one is Statically typed language where each variable and expression type is already known at compile time.Once a variable is declared to be of a certain data type, it cannot hold values of other data types.Example: C,C++, Java. Other, Dynamically typed languages: These languages can receive different data types over the time. Ruby, Python

Java is statically typed and also a strongly typed language because in Java, each type of data (such as integer, character, hexadecimal, packed decimal, and so forth) is predefined as part of the programming language and all constants or variables defined for a given program must be described with one of the data types.

Java has two categories of data:

    • Primitive data (e.g., number, character)
    • Object data (programmer created types)

Primitive data

Primitive data are only single values; they have no special capabilities. There are 8 primitive data types

boolean
boolean data type represents only one bit of information either true or false . Values of type boolean are not converted implicitly or explicitly (with casts) to any other type. But the programmer can easily write conversion code.

// A Java program to demonstrate boolean data type
class GeeksforGeeks
{
    public static void main(String args[])
    {
        boolean b = true;      
        if (b == true)
            System.out.println("Hi Geek");
    }   
}

Output:

Hi Geek

byte
The byte data type is an 8-bit signed two’s complement integer.The byte data type is useful for saving memory in large arrays.

  • Size: 8-bit
  • Value: -128 to 127
// Java program to demonstrate byte data type in Java
class GeeksforGeeks
{
    public static void main(String args[])
    {
        byte a = 126;
 
        // byte is 8 bit value
        System.out.println(a);
       
        a++;
        System.out.println(a);
        
        // It overflows here because
        // byte can hold values from -128 to 127
        a++;
        System.out.println(a);
        
        // Looping back within the range
        a++;
        System.out.println(a);
    }   
}

Output:

126
127
-128
-127

short
The short data type is a 16-bit signed two’s complement integer. Similar to byte, use a short to save memory in large arrays, in situations where the memory savings actually matters.

  • Size: 16 bit
  • Value: -32,768 to 32,767 (inclusive)

int
It is a 32-bit signed two’s complement integer.

  • Size: 32 bit
  • Value: -231 to 231-1

Note: In Java SE 8 and later, we can use the int data type to represent an unsigned 32-bit integer, which has value in range [0, 232-1]. Use the Integer class to use int data type as an unsigned integer.

long:
The long data type is a 64-bit two’s complement integer.

  • Size: 64 bit
  • Value: -263 to 263-1.

Note: In Java SE 8 and later, you can use the long data type to represent an unsigned 64-bit long, which has a minimum value of 0 and a maximum value of 264-1. The Long class also contains methods like compareUnsigned, divideUnsigned etc to support arithmetic operations for unsigned long.

Floating point Numbers : float and double
float
The float data type is a single-precision 32-bit IEEE 754 floating point. Use a float (instead of double) if you need to save memory in large arrays of floating point numbers.

  • Size: 32 bits
  • Suffix : F/f Example: 9.8f

double:
The double data type is a double-precision 64-bit IEEE 754 floating point. For decimal values, this data type is generally the default choice.

Note: Both float and double data types were designed especially for scientific calculations, where approximation errors are acceptable. If accuracy is the most prior concern then, it is recommended not to use these data types and use BigDecimal class instead.
Please see this for details: Rounding off errors in Java
char
The char data type is a single 16-bit Unicode character. A char is a single character.

  • Value: ‘\u0000’ (or 0) to ‘\uffff’ 65535
// Java program to demonstrate primitive data types in Java
class GeeksforGeeks
{
    public static void main(String args[])
    {
        // declaring character
         char a = 'G';
         
        // Integer data type is generally
        // used for numeric values
        int i=89;
        
        // use byte and short if memory is a constraint
        byte b = 4;
        
        // this will give error as number is
        // larger than byte range
        // byte b1 = 7888888955;
        
        short s = 56;
        
        // this will give error as number is
        // larger than short range
        // short s1 = 87878787878;
        
        
        // by default fraction value is double in java
        double d = 4.355453532;
        
        // for float use 'f' as suffix
        float f = 4.7333434f;
       
        System.out.println("char: " + a);
        System.out.println("integer: " + i);
        System.out.println("byte: " + b);
        System.out.println("short: " + s);
        System.out.println("float: " + f);
        System.out.println("double: " + d);
    }   
}

Output:

char: G
integer: 89
byte: 4
short: 56
float: 4.7333436
double: 4.355453532

 

Section 3KEYWORDS AND IDENTIFIERS IN JAVAFree Preview

A keyword is a reserved word from the Java keyword list provide the compiler with instructions. As keywords are reserved, they cannot be used by the programmer for variable or method names. Identifiers are the names of variables, methods, classes, packages and interfaces.

Identifiers start with a letter, underscore(_) or dollar sign ($). The following characters can be digits. Identifiers are case sensitive and have no maximum length.

Section 4FUNCTIONS / METHODS IN JAVA
Section 5YOUR FIRST JAVA PROGRAM
Section 6PARAMETER INPUT IN JAVA
Section 7OPERATORS IN JAVA
Section 8TERNARY / CONDITIONAL OPERATORS IN JAVA
Section 9IF-ELSE STATEMENT IN JAVA
Section 10FOR LOOP IN JAVA
Section 11DUMMY AND INFINITE LOOPS IN JAVA
Section 12PROGRAMS BASED ON FOR LOOP IN JAVA
Section 13MODULUS OPERATOR IN JAVA
Section 14Program to check whether a number is perfect in Java
Section 15Buffered Reader Input in Java
Section 16Solution to Buffered Reader
Section 17While/Do-While Loops in Java
Section 18Interconversion of Loops in Java
Section 19Switch-Case in Java
Section 20Menu-Driven program in Java
Section 21Program using while loop in Java
Section 22Buffered reader concepts review
Section 23Input using scanner class in Java
Section 24Nested loops in Java
Section 25Pattern printing using nested loops in Java
Section 26Complex patters in Java
Section 27Functions in Java
Section 28Access specifiers in Java
Section 29Object oriented programming
Section 30Classes and objects in Java
Section 31Constructors in Java
Section 32Inheritance in Java
Section 33Polymorphism and Function overloading in Java
Section 34Implementing Polymorphism
Section 35Introducton to Arrays
Section 36Working with arrays
Section 37Searching techniques in Java
Section 38Binary search in Java
Section 39More on Binary Search
Section 40Sorting in Java
Section 41Bubble sort in Java
Section 42Strings in Java
Section 43Extracting words from a string in java
Section 44More on strings
Section 45Traversing strings
Section 46Palindrome Numbers
Section 47Specimen Paper