Results 1 to 7 of 7

Thread: dissimilarities between c# and java

  1. #1
    Join Date
    Mar 2011
    Posts
    49

    dissimilarities between c# and java

    Hi, I am having exam of c# after a week in my college and I am very afraid because I am not prepared fully and sometimes I completely forget everything. Please tell me what the dissimilarities between c #and java are. This question can be asked for 5 to 10 marks. So please tell me minimum 5 points. Please provide the solution for this problem as far as possible because my exam is coming closer and I don’t want kt in this exam.

  2. #2
    Join Date
    May 2009
    Posts
    539

    Re: dissimilarities between c# and java

    C# and java both are object oriented programming(OOP) language but there are many differences between them and they are as follows:
    1. java does not support operator overloading where as c# supports operator overloading.
    2. java doesn’t support delegates and events where as c# supports delegates and events.
    3. c# allows the use of string expression in switch statement where as java allows use of string expression in switch statement.
    4. Java doesn't allow the creation of user-defined value types whereas c# allows the creation of user-defined value types.
    5. There is difference in ideas of enum in java and c#.

  3. #3
    Join Date
    Apr 2009
    Posts
    488

    Re: dissimilarities between c# and java

    The differences are as follows:
    • c# provides more versioning support.
    • In c#, the first character of main is capitalized where as in java it is not capitalized.
    • C# doesn't have Java's inner classes at all, in fact - all nested classes in C# are like Java's static nested classes.
    • In c# for printing we use System.Console.WriteLine whereas in java we use System.out.println.
    • Access modifiers are somewhat different in c# and java.

  4. #4
    Join Date
    Mar 2011
    Posts
    49

    Re: dissimilarities between c# and java

    Hi, I am in ty. I have a problem in c# program. The following program gives an error.
    Program: - using A=System. Console;
    class hello
    {
    public static void main()
    {
    A.WriteLine(“hello”)
    }
    }
    Please guide me and provide me proper solution so that I can solve and errors and see the result of my program.

  5. #5
    Join Date
    May 2009
    Posts
    527

    Re: dissimilarities between c# and java

    The program has two errors. They are compile time errors. Firstly the character m of main must be capitalized and secondly colon is missing. So modifying the program:
    Program: - using A=System. Console;
    Class hello
    {
    Public static void main()
    {
    A.WriteLine (“hello”)
    } }
    This is the correct program and will not give any errors.

  6. #6
    Join Date
    May 2009
    Posts
    511

    Re: dissimilarities between c# and java

    Hi, I had exam of c#. Paper was easy but couldn’t answer one question. The question was what the similarities between c #and java. This question was asked for 5 marks. Please provide minimum 5 similarities between c# and java. I wish if I could know this answer then I could have got scored more marks. Please help me and provide me the answer for the question what similarities between c #and java.

  7. #7
    Join Date
    May 2009
    Posts
    543

    Re: dissimilarities between c# and java

    The answer for the question what similarities between c #and java are as follow:-
    • c# and java support platforms like Linux, Mac OS X, and Solaris.
    • c# and java both support One-dimensional, zero-based index arrays.
    • c# and java both makes the use Try, catch and finally.
    • c# and java both support abstract method.
    • c# and java both support if statement, if- else statement, nested if –else and ladder if.

Similar Threads

  1. Replies: 4
    Last Post: 04-09-2013, 11:04 PM
  2. Replies: 7
    Last Post: 02-10-2011, 07:46 PM
  3. Java Programming using Adventnet SNMP Java API
    By ROCKING_Suhas in forum Software Development
    Replies: 5
    Last Post: 17-07-2010, 06:52 AM
  4. Link List Example in Java Sample program in Java
    By trickson in forum Software Development
    Replies: 2
    Last Post: 04-08-2009, 08:23 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,650,445.67780 seconds with 17 queries