Skip to main content
-3 votes
1 answer
102 views

I'm not super experienced with C#, and this is a bit of a puzzle. Consider the following code: #nullable enable using System.Collections.Generic; // Biology.dll public abstract class Animal { ...
suszterpatt's user avatar
  • 8,327
3 votes
1 answer
113 views

I have problems to implement any platform dependent classes in a MAUI project. The compiler produces errors if I use a method which has a return value. I implemented the function first for each ...
Tom's user avatar
  • 139
-1 votes
1 answer
49 views

Is it bad practice to use private to hide the implementation of a contract and not show it even in ide autocomplet. If so, why? interface MyService { fun process() } @Service private class ...
ARTWIN's user avatar
  • 3
3 votes
1 answer
128 views

I'm working on an ML.NET project where I load data into an IDataView, apply an ONNX model transformation, and then access the transformed output. My Input class is in the same assembly as my Output ...
FluidMechanics Potential Flows's user avatar
0 votes
1 answer
62 views

In my Student class, the variable is first set to: public String name; I access this in the other class named StudentUse class as follows: Student s1 = new Student(); s1.name= "sarang"; ...
Sarang Tripathi's user avatar
-1 votes
1 answer
61 views

What is the difference between public, protected, package-private and private in Java? The question's answer cannot answer my question. It's not a duplicate question. I totally know the diagram of ...
maplemaple's user avatar
  • 1,805
0 votes
0 answers
66 views

Imagine 10 public classes in a folder/namespace. I want to make all of them internal. Any way to do this using Rider without modifying each file manually?
me.at.coding's user avatar
  • 18.5k
4 votes
3 answers
216 views

I have a question about access modifiers override. First, let's look at the following code. fun main() { val b: AAA = BBB() b.testA() } open class AAA { fun testA() { println(&...
ybybyb's user avatar
  • 1,809
3 votes
5 answers
212 views

I have a Wheel class with two init-only properties Spokes and DiskBrake: public class Wheel { internal Wheel() { } public int Spokes { get; init; } public bool DiskBrake { get; init; } } ...
Theodor Zoulias's user avatar
2 votes
0 answers
135 views

In C# 11, the new file type modifier was introduced. I was looking for a way to detect such non-public type using reflection, however, I have not find any "good" way to do so. There is no Is…...
Matt Stuvysant's user avatar
2 votes
2 answers
463 views

This code: public class Class1 { private Class2 _class2; private void Something() { Class2 class2; } } file class Class2 { } produces compiler error CS9051 on the member ...
rory.ap's user avatar
  • 35.7k
1 vote
1 answer
169 views

Scala noob here, but while learning about case classes, I see the members are by default read-only. However, if you add var, they become private; and there is no public access modifier. Any way to ...
mishar's user avatar
  • 455
4 votes
3 answers
339 views

Is it possible to implement protected and private access modifiers for classes with decorators in python? How? The functionality should be like the code below: class A: def public_func(self): ...
Ehsan's user avatar
  • 147
0 votes
0 answers
90 views

class Cat { int j; Cat(int j) { this.j = j; } } class Dog implements Cloneable { int i; Cat c; Dog(Cat c, int i) { this.c = c; this.i = i; } ...
Mayor23's user avatar
1 vote
0 answers
363 views

I write this code struct Test { public override string ToString() => "some text"; } Then I get a compiler message suggestion IDE0251 Member can be made 'readonly' this ...
Pawulon's user avatar
  • 77

15 30 50 per page
1
2 3 4 5
71