Posts

Showing posts from October, 2021

OOP's Polymorphism

 It provides different services but the same name/domain . Polymorphism is implemented by method overloading. Example :  class ploy{     public static void main ( String [] args){         ploy obj = new ploy();         obj.arae( 10 );         obj.area( 5 , 3 );     }     void area( int a){         System.out.println( "area 1 : " + a*a);     }     void arae( int a, int b){         System.out.println( "area 2 " + a*b);     } }

OOP's Constructor

 The constructor is also a method. No return/keywords such as void, int, float etc, are not used before method name. Constructor name also created using class name . No calling required. Constructoer is automatically called while creating an object. Example 01 - file saveAs cons.java compail command - javac cons.java   ↪ java cons     ↪ class cons{     public static void main( String [] args){         cons obj = new cons();     }     cons(){         System.out.println( 'Hello world' );     } } Example 02 - file saveAs  squar.java compail command - javac squar.java   ↪ java  square      ↪ class squar{     public static void main( String [] args){         squar obj1 = new squar( 20 );     }     squar( int a){         System.out.println( "Area = " + a*a);   ...

OOP's Class

Class is a template to create objects. The class consists of attributes and operations. Class Declation  class className{ } Object Creation className objectName = new className(); ex: rectangle smallarea = new rectangle (); Operation / Method No return - void          void area(){          .......           } return - int / string etc.         int area(){         .......     return 0;         }

What kind of background knowledge is required for computer science?

What kind of background knowledge is required for computer science? 1. At least one programming language (Python, C++, Java, C#, Javascript, C, Haskell, Ruby, Rust, Scala) is required. We need you to be able to write programs that can:  1) read data from the standard input (usually a sequence of integers);  2) compute the result (usually a few loops suffice); and  3) print the result to the standard output.  2. A basic understanding of discrete mathematics: induction, contradiction, and proof by induction. For analyzing algorithms (proving correctness, predicting execution time) and algorithmic reasoning in general, discrete mathematics is required. We recommend that you take our partner specialization, Introduction to Discrete Mathematics for Computer Science if you wish to brush up on your discrete mathematics skills. It takes a try-this-before-we-explain-everything method to teach discrete mathematics: you'll be tackling a variety of interactive puzzles that were ...