Posts

Java vs Typescript Syntax

Image
  Hi, the post is only related to the comparison between the basic  syntax  in Java & Typescript. We may need a  class  and a  main function   in  Java  to print a text in the console unlike in  Typescript . Syntax Differences b/w Java & Typescript : Classes: Functions: Variables inside a Class: Variables inside a method: Deep Dive into the Typescript: Types: When we try to return number instead of String for string type function, it throws error Types can be customized with multiple return types. Always throws error when we try to return value that is not defined Not only primitive types but also values can be assigned as types. It throws error if an undefined value is being returned The main advantage of using types is not only it strict developer to give invalid values but also gives suggestions to use available values. A function can be a multi-purpose action. Maybe Method overloading is the solution for Java 🤕 What if a fun...