TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Par ma
NA
6
799
Please rectify this C# error I tried using google also.
Nov 11 2017 4:46 AM
using System;
using System.Collections.Generic;
namespace GenericApplication
{
public class MyGenericApplication<T>
{
private T[] array;
public static MyGenericArray(int size)
{
return MyGenericArray[size];
}
public T getItem(int index)
{
return array[index];
}
public void setItem(int index,T value)
{
return array[index]=value;
}
}
class tester
{
public static void Main(string[]args)
{
MyGenericArray<int> intArray=new MyGenericArray<int>(5);
for (int c=0;c<5;c++)
{
intArray.setItem(c,c*5);
}
for (int c=0;c<5;c++)
{
Console.Write(intArray.getItem(c)+" ");
}
Console.WriteLine();
MyGenericArray<char> charArray=new MyGenericArray<char>(5);
for (int c=0;c<5;c++)
{
charArray.setItem(c,(char)(c+97));
}
for (int c=0;c<5;c++)
{
Console.Write(charArray.getItem(c)+" ");
}
Console.WriteLine();
}
}
}
main.cs(8,16): error CS1520: Class, struct, or interface method must have a return type
Reply
Answers (
3
)
Win32_ScheduledJob is not returning any result in c#
Want to create a one to one chat in site using SignalR?