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
Rashmi kaneri
NA
6
5.7k
How to call function and variables declared in other classes
Aug 19 2016 12:32 AM
hi,
i have function stringconcat(a,b) in class1 with namespace s1 and want to call this function in class2.
i have written as given below and getting errors like
Error 1 Cannot declare a variable of static type 's1.class1'
Error 2 Cannot create an instance of the static class 's1.class1'
Can someone please tell me what is wrong in this code
In file1.cs
-------------
namespace s1
{
publis static class class1
{
public static string a="IN";
public static string b="DIA";
public static void stringconcat(a,b);
}
}
In File2.cs
----------------
namespace s1
{
publis static class class2
{
class1 class1=new class1();
class1.stringconcat(a,b);
}
}
Reply
Answers (
3
)
how can i make an app read a repository and save the link ?
Project Ideas to learn OOP