Home
Blogs
Questions
Jobs
Monetize

Home

About Us

Blogs

Questions

Jobs

Monetize

Post Job

banner

Questions about class-instance-variables

Read more about class-instance-variables

python (65.2k questions)

javascript (44.3k questions)

reactjs (22.7k questions)

java (20.8k questions)

c# (17.4k questions)

html (16.3k questions)

r (13.7k questions)

android (13k questions)

Questions - class-instance-variables

How to get the maximum value among the arguments of class objects in Python?

I have sample class and instances: class A: def __init__(self, num) #instances a = A(2) b = A(4) c = A(5) d = A(7) In another class (class B) within a method, I have to get the highest value amon...
test-img

chilliyayi

python

class

class-method

python-class

class-instance-variables

Votes: 0

Answers: 3

Latest Answer

you need to iterate over the list and get the maximum element >>> >>> class B: ... def __init__(self, point_list): ... self.pl = point_list ... def com(self): .....
test-img

sahasrara62

Can I use a class instance as an argument for a generic in java?

I am passing a class as a parameter to a method and I need to create an instance of that class, something like public void setPiece(int i0, int j0, Class<Piece> pieceClass) { Piece p = n...
test-img

Daniel Barac

java

class

generics

constructor

class-instance-variables

Votes: 0

Answers: 1

Latest Answer

Ah, you've misread how to make Constructor instances. You can't new them up - you ask the Class for it. Looks like this: try { Constructor<Piece> ctr = pieceClass.getConstructor(argTypes); p...
test-img

rzwitserloot

Posts

Questions

Blogs

Jobs

The ultimate platform for coders and IT specialists

About

  • Company
  • Support

  • Platform

  • Terms & Conditions
  • Privacy statement
  • Cookie policy
  • Cookie option
  • OnlyCoders © 2025  |  All rights reserved