Ans: Dart is an application programming language. It is used to build web, server and mobile applications.
Ans: Dart is mainly used to build structured modern web apps.
Ans: Dart follows C Style Syntax and is Class-Based, Object Oriented Language which supports single inheritance.
Ans: Google is doing its hard work to get Dart accepted by web developers and community and arranging support, tools and execution environment for Google Dart.
Ans: The following code for simple program:
main() {
print("Hello World!");
}
There are two ways to execute Dart program:
Ans: Yes, Dirt is case sensitive programming language.
Ans: There are following data types in Dart language:
Ans: In Dart, rune is an integer representing Unicode code point.
Ans: No, Dart has not syntax for declaring interface.
Ans: A Lambda function is a concise mechanism to represent functions. These functions are known as Arrow functions.
Example:
void main() {
printMsg();
print(test());
}
printMsg()= >
print("hello");
int test()= 123;
// returning function
Ans: In Dart, this keyword refers to the current instance of the class.
void main() {
Car c1 = new Car('E1001');
}
class Car {
String engine;
Car(String engine) {
this.engine = engine;
print("The engine is : ");
}
}
Ans: Getters and Setters allow the program to initialize and retrieve the value of class fields. It is also known as accessors and mutators.
Ans: In Dart, type-checking is used to check that a variable hold only specific to a data type.
String name = 'Smith';
int num = 10;
void main() {
String name = 1; // variable Not Match
}
Ans: There are given various string functions:
String Methods | Description |
---|---|
toLowerCase() | It converts all string characters in to lower case. |
toUpperCase() | It converts all string characters in this to upper case. |
trim() | It returns the string without any whitespace. |
compareTo() | It compares this object to another. |
Ans: There are two types of list in Dirt that are given below:
Ans: In Dart, Method Overriding is a technique that child class redefines a method in its parent class.
Example:
void main() {
Child c = new Child();
c.m1(12);
}
class Parent {
void m1(int a){ print("value of a ");}
}
class Child extends Parent {
@override
void m1(int b) {
print("value of b ");
}
}
Ans: WebStorm editor is used to enables breakpoint and step by step debugging.
Ans: In Dart, A typedef (Or function types alias) helps to define pointer to execute code within memory.
Syntax:
typedef function_name(parameters)
Ans: The file extension of Dart is .Dart.
Ans: There are various methods to manipulate string that are given in table:
String Methods | Description |
---|---|
toLowerCase() | It converts all the string character into lower case. |
toUpperCase() | It converts all the string character into upper case. |
trim() | It returns the string without any leading and trailing whitespace. |
compareTo() | It compare objects to another objects. |
Ans: No, Class declarations are themselves interfaces in Dart.
Ans:In Dart, pub is a tool for manage Dart packages.