Saturday, 14 August 2021

JAVA

Java:

 Java is a OOP originally developed by sun microsystems which was initieted by Jems Gosling and released in 1995. It is owned by oracle and more than 3 billion devices run java. 

Java is a High Level, Object-Oriented, Secure Programming Language, High Performance, Robust, Platform Independent, Multi thread, Portable Programming Language. It own Java Runtime Environment (JRE) and Application Programming Interface (API). 

Use of Java:

Java is used for -

  1. Mobile applications (specially android apps) 
  2. Desktop applications
  3. Web applications
  4. Web server and application servers
  5. Games
  6. Data base connection. 

Advantage of Java:

  1. Java works on different platforms (Ma-windows, Mac, Linux, etc.) 
  2. It is one of the most popular programming language in the world. 
  3. Simple and easy to learn. 
  4. Open source and free. 
  5. It is a fast, secure, powerful programming language. 
  6. Java is a OOP which gives a clear structure to programs and allow code to be reused, lowering development cost. 
  7. Huge community support. 
  8. As Java is close to C and C++, it makes easy for programmers to switch to Java or vice versa. 

Features of Java:

1) Simple. Java is easy to learn and it's syntax is quite simple, clean and easy to understand. The confusing and ambiguous concept of C++ are either left out in Java or they have been re-implimented in a cleaner way. 

     Example- Pointers and operator overloading are not there in Java but we're an important part of C++.

2) Object oriented. In Java, everything is an object which has some data and behaviour. Java can be easily extended as it is based on object model. 

Some basic concept of OOP's are-

(i) Object

(ii) Class

(iii) Inheritance

(iv) Polymorphism

(v) Abstraction

(vi) Encapsulation

3) Robust. Java makes an effort to eliminate error prone codes by emphasizing mainly on compile time error checking and runtime error checking but the main areas which Java improved were memory management and mishandled exceptions by introducing automatic garbage collector and exception handling. 

4) Platform independent. Unlike other programming languages such as C, C++ etc which are compiled into platform specific machines. Java is guaranteed to be write once, run anywhere any language. 

On compilation Java program is compiled into byte code. This byte code is platform independent and can be run on any machine. This byte code formate also provide security. Any machine with Java run time environment can run Java program. 

Java program — [Byte code] - {Linux OS

                                                       Windows OS

                                                        Mac OS}

5) Secure. When it come to security, Java is always to first choice. With Java secure features it enable us to develop virus free, temper free system. Java program always runs in Java runtime environment with almost null interaction with system OS, hence, it is more secure. 

6) Multi threading. Java multi threading feature make it possible to write program that can do many tasks simultaneously. Benefits of multi threading is that is utilizes same memory and other resources to execute multi threads at the same time, like while typing, grammatical errors and checked along. 

7) Architectural neutral. Compiler generates byte codes, which have nothing to do with a particular computer architecture. Hence, a  java program is easy to interpret on any machine. 

8) Portable. Java byte code can be carried to any platform. No implementation dependent features. Everything related to storage in predefined

    Example- size of primitive data types. 

9) High performance. Java is an interpreted language, so it will never be as a compiled language like C or C++. But Java enables high performance with the use of just-in -time compiler. 

10) Distributed. Java is also a distributed language. Programs can be designed to run on computer networks. Java has a special class library for communicating using TCP/IP protocols. Creating network connections is very much easy in Java as compared to C/C++.

Java keywords:

There are 50 keywords in Java i.e.

abstruct

byte

class

do

extends

for

import

long

private

short

switch

throws

volatile

 

 

assert

case

const

double

final

goto

instance of

native

protected

static

synchronized

transient

while

boolean

catch

continue

else

finally

if

int

new

public

strictfp

this

try

break

char

default

enum

float

implement

interface

package

return

super

throw

void

 


Data types in java:

In java there are two types of data types-

  1. Primitive
  2.  Non primitive

1. Primitive data types-

  • Numeric
  • Non numeric

  • Numeric - 
         (i) integer- byte, short, int, long

         (ii) floating point - float, double

  • Non numeric - 
         (i) character, boolean 

2. Non primitive data types-

  • class, array, interface



     

Thursday, 12 August 2021

Inheritance

Inheritance:

It is a important feature implemented OOP system by which one class can get all of the properties from another one class along with the same. It can take some new property of its own. 

Syntax:
  class     derived class name: visibility mode     base class name. 
  {
     - - - - - - -
     - - - - - - - 
     - - - - - - -
 }

Types of inheritance:

Now class can be derived from an existing class then the new derived class is called derived class or sub-class and the existing class is called base class or super class. And it is said that the sub class inherits from the base class. It is may take place in many terms. Such as:

1. Single inheritance
2. Multiple inheritance
3. Hierarchical inheritance
4. Multi-level inheritance
5. Hybrid inheritance

1. Single inheritance- When a subclass inheritance from one base class, it is known as single inheritance. 
         X
         ↓
         Y
2. Multiple inheritance- When a subclass inherits from multiple base classes, it is known as multiple inheritance. 
        X     Y
         ↘  ↙
            Z
3. Hierarchical inheritance- When many subclasses inherits from a single base class, it is known as hierarchical inheritance. 
           W
         ↙↓↘
      X   Y   Z
4. Multilevel inheritance- The translative nature of inheritance is reflected by this form of inheritance. When a subclass inherits from a class that itself inherits from another class, it is known as multilevel inheritance. 
           X
           ↓
           Y
           ↓
           Z
5. Hybrid inheritance- When a subclass inherits from multiple base classes and all of the its base classes inherits from a single base class this form of inheritance is known as hybrid inheritance. 
   In otherwords, The combination of multiple inheritance and hierarchical inheritance is known as hybrid inheritance. 
             W
           ↙ ↘
          X     Y
          ↘  ↙
             Z


Wednesday, 11 August 2021

Constructor in C++

Constructor in C++

 Constructor is a special member function whose task is to initialise the object of its class. It is special because its name is same as the class name. It is called constructor because it construct the value of data members of the class. Constructor is having no return type. 

Types of Constructor:

There are 3 types of constructor in C++

1. Default Constructor: 

Default constructor is the one which does not accept any value. It is mainly used to initialize the instance variable with the default values. It can also be used for performing some useful task on object creation. A default constructor is invoked implicity by the compiler if there is no constructor defined in the class. 

2. Parameterized Constructor:

Parameterized constructor is the one which can initialize the instance variables with the given values. In otherwords, the constructor which can accept the arguments are called parameterized constructor. 

3. Copy Constructor:

The constructor which is initializes an object using another object of same class is called copy constructor. 

Saturday, 7 August 2021

What is C++ ?

 C++ programming :

C++ is a general purpose object oriented programming (oop) language developed by Bjarne Stroustrup. 

C++ was developed at AT & T's Bell laboratories of USA in early 1980's. It was expended version of 'C'. 

Difference between C and C++ :

The major difference between C and C++ is that 'C' is a procedural programming language and does not support class and object, while C++ is a combination of both procedural and object oriented programming language; therefore C++ can be called a hybrid language. 

Data types used in C++ :

Data types in C++ can be classified under various categories as shown below

c++ data types -

1) User-defined type-

     structure, union, class, enumeration

2) Built in type-

     (i)  integral - int, char

     (ii) void

     (iii) floating type - float, double

3) Derived type -

     array, function, pointer, reference

Operators used in C++ :

1) All 'C' operators are valid in C++ also. 

2) In addition C++ introduce some new operators also. 

Stream operators-

     :: ( scope resolution operator) 

     : (colon operator) 

    ・(class member access operator) 

     endl (line feed operator) 

     setus (field with operator) 

Stream operators -

     << and >> (stream operators) in C++ provide alternative to using printf (), scanf (), and other functions defined in stdio.h.

C in function. The C in function takes input from user. 

Syntax- Cin >> variable name ;

(The >> operator is thrown as the extraction or get from operator. It extracts or takes a value from keyboard. 

C out function. The C out function display output on the screen. 

Syntax- Cout << "message" << variable name<< endl ;

(The << operator is thrown as the insertion put the operator. It insert or send the contents of the variable. 

Program-

// write a C++ program to enter any two numbers and find out their sum and average

# include < iostream.h >

# include < conio.h >

void main () 

{

     into x, y ;

     float sum, average ;

     Cout << " enter the value of x =  " << x <<         endl ;

     Cin >> x ;

     Cout << " enter the value of y =  " << y <<         endl ;

     Cin >> y ;

     sum = x + y ;

     average = sum/2 ;

     Cout << " sum =  " << sum << endl ;

     Cout << " average =  " << average << endl ;

     getch () ;

}

Output :

      enter the value of x = 10

      enter the value of y = 6

      sum = 10 + 6 = 16

      average = 10 + 6 / 2 = 8

C++ is a general purpose object-oriented programming (OOP) language developed by Bjarne stroustrup. C++ was developed at AT & T's bell laboratories of U.S.A in early 1980's. C++ was expended version of C.

 C++ keywords:

asm              double           new             switch

auto             else                operator    template

break           enum             private        this

case             extern           protected     throw

catch           float              public            try  

char             for                 register       typedof  

class            friend            return           union

const           goto              short           unsigned

continue     if                   signed            virtual

default        inline            sizeof             void

delete          int                  static            volatile 

do               long                struct             while 

Added by ANSI C++

bool

const_cast

dynamic_cast

explicit

 

export

false

mutable

namespace

reinterpret_cast

static_cast

true

typeid

typename

using



Sunday, 1 August 2021

Vertical Button Bar in TALLY. ERP 9

  The buttons are designed to make the work easier and faster, they very from one screen to another based on the screen functionality. They appear on the right hand side of the Tally. ERP 9 screen and inactive buttons are greyed out. You can either click these buttons or press the shortcut keys to access the relevant screen

The following are some of the buttons and their functions:

F1: Select Cmp: Display list of the all companies available in the database of tally. It displays the list of companies screen where you can select the desired company in which you want to work. 

F1: Shut Cmp: Allows you to unload (disable) a company. In case you again want to work on the same company, you can load (enable) in it by pressing F1. 

F2: Date: Allows you to set the date. 

F2: period: Allows you to set the starting and ending dates of financial year of a company. 

F3: Company: this button helps you to switch from one active company to another active company. 

F3: Company Info: Select this option by pressing ALT and F3 keys simultaneously. This involkes the company info. menu. 

F4: Connect: It allow you to connect with Tally. Net. 

F11: Features: It displays the company features menu which you can use to set option for accounting, inventory, statutory & taxation, etc. 

F12: Configure: this button display the configuration menu which you can use to configure currency, printing, data, vouchers, invoices, etc. 

Minimise Button: The Minimise Button performs the standard Windows Operating System function, allowing you to minimize Tally. ERP 9 and work on other applications. To restore Tally. ERP 9, click on the Tally. ERP 9 icon on the taskbar. 

Close Button: The Close Button in the upper right corner functions similar to the use of Esc in Tally. ERP 9. It brings you to back to the Gateway of Tally. ERP 9 from any screen. 

PHOTO ELECTRIC EFFECT - DEFINITION, LAW AND EINSTEIN'S THEORY

 Photo electric effect Consider a negativity charged zinc plate connected to a gold leaf electroscope (Fig. 1). The divergence in the leaves...