consider an example : public class MyClass { private int myProperty; public void setMyProperty(int value) { myProperty = value; } public int getMyProperty() { return myProperty; } } This is the same thing in C#: public class MyClass { public int MyProperty {get; set;} }
thankeshwor · Sep 2, 2020 8:24 AM · 18,220 views
Try using Lombok you can write same code like this in java: @Getter @Setter public class MyClass { private int myProperty; }
Hawagiri02 · Sep 2, 2020 4:36 PM
LOL Java and C# is similar Python is different
deepocean · Sep 2, 2020 9:00 PM
Relatively long syntax
thankeshwor · Sep 8, 2020 6:03 AM
I prefer Javaskript, much simpler objects var myClass = {myproperty: "name-here" };
AeX5m7zBC6jf4Z · Sep 22, 2020 2:09 AM
Slight variation to one of the above responses: @Data public class MyClass { private int myProperty; }
Nepali-IN-USA · Sep 22, 2020 3:58 PM
to print ' hello world' yo have to go though a long syntax public static void main(String ... args) { System.out.println(randomString(-229985452)+' '+randomString(-147909649)); } public static String randomString(int seed) { Random rand = new Random(seed); StringBuilder sb = new StringBuilder(); for(int i=0;;i++) { int n = rand.nextInt(27); if (n == 0) break; sb.append((char) ('`' + n)); } return sb.t0script(); }
tps2gc · Sep 23, 2020 7:47 AM
Try this:- System.out.println("Hello World");
Hawagiri02 · Sep 23, 2020 6:37 PM
Things now much more simpler than it used to be .
tps2gc · Sep 23, 2020 7:48 PM
This conversation is preserved exactly as it was on the original Sajha.com and can't accept new replies.
Start a New Discussion