<svg xmlns="http://www.w3.org/2000/svg" viewBox="0, 0, 822.93, 461.45" font-family="monospace" font-size="14"><g fill="#3e3e3e"><rect x="0" y="0" width="822.93" height="461.45" fill="#f4f4f4"/><text x="36.8" y="34.55"> 1 : /**</text><text x="36.8" y="53.55"> 2 : * Variables without a value must initialize with a data type identifer.</text><text x="36.8" y="72.55"> 3 : * Default value of a variable is always null.</text><text x="36.8" y="91.55"> 4 : */</text><text x="36.8" y="110.55"> 5 : void main() {</text><text x="36.8" y="129.55"> 6 : </text><text x="36.8" y="148.55"> 7 : // variables without a Data Type must be defined with Data Type identifiers</text><text x="36.8" y="167.55"> 8 : int myNumber; // `int` Data Type is for integer values</text><text x="36.8" y="186.55"> 9 : double myDouble; // `double` Data Type is for floating-point numbers</text><text x="28.4" y="205.55"> 10 : String myString; // `String` Data Type is for string values (sequence of characters)</text><text x="28.4" y="224.55"> 11 : </text><text x="28.4" y="243.55"> 12 : // variables without an initial have `null` values</text><text x="28.4" y="262.55"> 13 : // we can also assign `null` to a variable at variable declaration or at anytime</text><text x="28.4" y="281.55"> 14 : // `null` signifies no-value or empty-value</text><text x="28.4" y="300.55"> 15 : bool myBoolean = null;</text><text x="28.4" y="319.55"> 16 : </text><text x="28.4" y="338.55"> 17 : print( myNumber ); // null</text><text x="28.4" y="357.55"> 18 : print( myDouble ); // null</text><text x="28.4" y="376.55"> 19 : print( myString ); // null</text><text x="28.4" y="395.55"> 20 : print( myBoolean ); // null</text><text x="28.4" y="414.55"> 21 : }</text><text x="28.4" y="433.55"> 22 : </text></g></svg>
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.