0% found this document useful (0 votes)
6 views4 pages

Beginner Devloper Questions

The document contains a series of programming questions and code snippets related to C# and SQL. It includes inquiries about method outputs, error handling, interface implementation, and differences between programming constructs. Additionally, it provides a SQL query to retrieve employee data based on salary criteria over the last three months.

Uploaded by

dhandavikram348
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views4 pages

Beginner Devloper Questions

The document contains a series of programming questions and code snippets related to C# and SQL. It includes inquiries about method outputs, error handling, interface implementation, and differences between programming constructs. Additionally, it provides a SQL query to retrieve employee data based on salary criteria over the last three months.

Uploaded by

dhandavikram348
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Creatif Technologies Pvt Ltd.

C#
1) Below given method will return output as “test”?

public void Test ()


{
return "test”;
}

 Answer: _________________________________________________

2) Find out mistake from below given code

public interface Itest


{
bool test ();
}

public class test; Itest


{
Public bool test ()
{
Return true;
}
}

 Answer: _________________________________________________

3) Given code will execute if we call A class in Main Method?

public class A
{
Int b = 12345678910;

Public int test ()


{
Return b;
}
}

Answer: _________________________________________________

4) What exception will throw below method if we call A class in Main Method.
If exception, then how to handle in below class

 Answer_________________________________________________________

public class A
{
Int? b = null;

Public int test ()


{
Int c = Convert.ToInt32(b);
Return c;
}
}
5) In below example Itest interface implemented by test class and test class
contain test2() method which one not defined in Itest interface class so
below code will execute?

If code will execute then specify reason else not required reason.

public interface Itest


{
bool test ();
}

public class test: Itest


{
Public bool test ()
{
Return true;
}

Public bool test2()


{
Return true;
}
}

 Answer_________________________________________________________

6) What output will come from below loop or it will give compile time error
or run time error.

string [] arr = new string [2];


arr[0] = "abc";
arr[1] = "xyz";

for (int i = 0; i < length.arr; i++)


{
Console.WriteLine(arr[i]);
}

 Answer_________________________________________________________

7) Is below given example will work please specify.


If not worked, then how to handle specify
here_____________________________________________________________________
__
_____________________________________________________________________________________
__

Public int test ()

{
int A = 0;
string B = "we";

A = Convert.ToInt32(B);

Return A;
}

8) How to write foreach on list of class object


Class obj1 =new Class obj1();
Obj1.id = 1;
Obj1.id = 2;
Obj1.id = 3;
Obj1.id = 4;

List<class> listnew= new list();


Answer:

9) Difference between break and continue keyword in C#.

Answer:
For(int i=0; I < 5;i++)
{
If(i==3)
{
Continue;
}
Console.writeline(i);
}

10) Difference between while loop and do while in C#.

Answer:

Int j =5;

do{

//some action here


Console.writeline(“test”);

} while(j < 6)
Employee Write a query for out: List of Employee who has last 3 months
Emp_Id salary total >=150000
Emp_name
Department Detail Require:
Salary_Amount
Emp_Name
Department
Salary_Master
Monthly_Salary
Salary_Id
Cumulative_Salary
Empl_Id
Salary_date
Salary_Amount

select
e.Emp_Name,
e.Department,
e.Monthly_Salary,
(e.Monthly_Salary * 3) as Cumulate_salary
from
Employes e
where
(e.Monthly_Salary * 3) >= 150000;

You might also like