Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Java
  4. What are some of the equivalent statements of C# in Java?

What are some of the equivalent statements of C# in Java?

Scheduled Pinned Locked Moved Java
oopcsharpjavahelpquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    atoi_powered
    wrote on last edited by
    #1

    I know C# a little and I have an programming exam which is in Java, tomorrow. Therefore I'll be glad if you tell me what some of the equivalent statements of C# in Java mentioned below are. Thanks for your help. Some of C# statements: *** Console.WriteLine(string str) *** Console.Write(string str) *** Console.ReadLine(string str) *** // Inheritance *** // Polymorphism *** // LinkedList *** // Interface *** // Overloading Operators/Functions *** // Properties And any other simple differences which you think I have to know. The exam itself is not a full-coding-type exam but it's not completely free of codes! Thanks again :)

    N L T 3 Replies Last reply
    0
    • A atoi_powered

      I know C# a little and I have an programming exam which is in Java, tomorrow. Therefore I'll be glad if you tell me what some of the equivalent statements of C# in Java mentioned below are. Thanks for your help. Some of C# statements: *** Console.WriteLine(string str) *** Console.Write(string str) *** Console.ReadLine(string str) *** // Inheritance *** // Polymorphism *** // LinkedList *** // Interface *** // Overloading Operators/Functions *** // Properties And any other simple differences which you think I have to know. The exam itself is not a full-coding-type exam but it's not completely free of codes! Thanks again :)

      N Offline
      N Offline
      Nagy Vilmos
      wrote on last edited by
      #2

      atoi_powered wrote:

      I know C# a little and I have an programming exam which is in Java, tomorrow

      Too late. Far, far too late.

      // java code to write to stdout
      System.out.println(Object);
      //or
      System.out.print(Object); // no line feed

      // reading you need to open a reader:
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

      String input = null;

      try {
      input = br.readLine();
      } catch (IOException ioe) {
      System.out.println(ioe);
      }

      // Inheretance
      class Child extends Parent {
      // ...
      }

      My advice is stay up all night and start reading. Fast!


      Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett

      A 1 Reply Last reply
      0
      • A atoi_powered

        I know C# a little and I have an programming exam which is in Java, tomorrow. Therefore I'll be glad if you tell me what some of the equivalent statements of C# in Java mentioned below are. Thanks for your help. Some of C# statements: *** Console.WriteLine(string str) *** Console.Write(string str) *** Console.ReadLine(string str) *** // Inheritance *** // Polymorphism *** // LinkedList *** // Interface *** // Overloading Operators/Functions *** // Properties And any other simple differences which you think I have to know. The exam itself is not a full-coding-type exam but it's not completely free of codes! Thanks again :)

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        I don't know whether you are a fast learner, but you could take a look at the Java Tutorials[^].

        speaking as ...

        1 Reply Last reply
        0
        • N Nagy Vilmos

          atoi_powered wrote:

          I know C# a little and I have an programming exam which is in Java, tomorrow

          Too late. Far, far too late.

          // java code to write to stdout
          System.out.println(Object);
          //or
          System.out.print(Object); // no line feed

          // reading you need to open a reader:
          BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

          String input = null;

          try {
          input = br.readLine();
          } catch (IOException ioe) {
          System.out.println(ioe);
          }

          // Inheretance
          class Child extends Parent {
          // ...
          }

          My advice is stay up all night and start reading. Fast!


          Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett

          A Offline
          A Offline
          atoi_powered
          wrote on last edited by
          #4

          You're right but the exam is algorithmic and it doesn't depend on bunches of codes! I don't know why but the professor asked us to write the coding problems in Java. I think it will be fun, wish me luck :)

          1 Reply Last reply
          0
          • A atoi_powered

            I know C# a little and I have an programming exam which is in Java, tomorrow. Therefore I'll be glad if you tell me what some of the equivalent statements of C# in Java mentioned below are. Thanks for your help. Some of C# statements: *** Console.WriteLine(string str) *** Console.Write(string str) *** Console.ReadLine(string str) *** // Inheritance *** // Polymorphism *** // LinkedList *** // Interface *** // Overloading Operators/Functions *** // Properties And any other simple differences which you think I have to know. The exam itself is not a full-coding-type exam but it's not completely free of codes! Thanks again :)

            T Offline
            T Offline
            TorstenH
            wrote on last edited by
            #5

            I have an programming exam which is in Java, tomorrow I can see what happens here[^] Good luck.

            regards Torsten When I'm not working

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups