Professional Documents
Culture Documents
Find and Fix
Find and Fix
THE ERROR
EXAMPLE Error Correction
• using System; • System.out.print is a • using System;
• { • {
}
}
}
Problem 3
using System;
namespace
namespace Data_types{
class Program
{
static void Main(String[] args)
{
int abstract=1;
double return=2;
}
}
}
Problem 4
using System;
namespace
namespace Compare{
class Program
{
static void Main(Char[] args)
{
int x=5;
char comp=‘a’;
bool c= x>comp;
bool d= (bool)comp;
Console.WriteLine(c);
}
}
Problem 5
using System;
namespace
namespace sample{
class Program
{
static void Main(String[] args)
{
int num1=5;
Int num2= 10;
char letter=‘a’;
Int convert= (int) letter;
bool total=num1+num2;
Console.WriteLine(convert);
Console.WriteLine(total);
}
}
}
Answer 1
• ERROR • CORRECTION
using System;
namespace must not started to Add
numbers namespace
namespace 1Add{
class Program
{
static void Main(String[] args)
{
Console.WriteLine(“ADD”);
Console.ReadKey();
}
}
}
Answer 2
• CORRECTION
• ERROR
using System;
Char cannot be convert into sbyte namespace
namespace Convert{
class Program
{
static void Main(String[] args)
ushort, int, uint, long, ulong, float, or double
{
char text=‘a’;
sbyte conv= text;
Console.WriteLine(conv);
}
}
}
Answer 2
• CORRECTION
• ERROR using System;
Abstract and return is reserved namespace
words namespace Data_types{
class Program
{
Used proper identifiers static void Main(String[] args)
{
int abstract=1;
double return=2;
}
}
}
• CORRECTION