Posts

Showing posts from June, 2019

JAVA SYLLABUS

OBJECT ORIENTED PROGRAMMING USING JAVA UNIT-1 FUNDAMENTALS OF OBJECT – ORIENTED PROGRAMMING : Introduction, Object Oriented paradigm, Basic Concepts of OOP, Benefits of OOP, Applications of OOP , Java features: OVERVIEW OF JAVA LANGUAGE : Introduction, Simple Java program structure, Java tokens, Java Statements, Implementing a Java Program, Java Virtual Machine, Command line arguments. CONSTANTS, VARIABLES & DATA TYPES: Introduction, Constants, Variables, Data Types, Declaration of Variables, Giving Value to Variables, Scope of variables, Symbolic Constants, Type casting, Getting Value of Variables, Standard Default values; OPERATORS & EXPRESSIONS . UNIT-II DECISION MAKING & BRANCHING: Introduction, Decision making with if statement, Simple if statement, if. Else statement, Nesting of if. else statements, the else if ladder, the switch statement, the conditional operator. LOOPING : Introduction,   The   While   statement, the do-while st

Parameters used in Java Programs

Image

check whether the number is even or odd

import java.util.Scanner; public class Odd_Even {     public static void main(String[] args)     {         int n;         Scanner s = new Scanner(System.in);         System.out.print("Enter the number you want to check:");         n = s.nextInt();         if(n % 2 == 0)         {             System.out.println("The given number "+n+" is Even ");         }         else         {             System.out.println("The given number "+n+" is Odd "); }     } }

Sum of two numbers

public class AddTwoNumbers  {    public static void main(String[] args)  {               int num1 = 5, num2 = 15, sum;       sum = num1 + num2;       System.out.println("Sum of these numbers: "+sum);    } }

Factorial Program

class  FactorialExample{     public   static   void  main(String args[]){      int  i,fact= 1 ;      int  number= 5 ; //It is the number to calculate factorial         for (i= 1 ;i<=number;i++){           fact=fact*i;       }       System.out.println( "Factorial of " +number+ " is: " +fact);      }   }  

JAVA MATERIAL