Java Assignment, add value to variable in different class

Java Assignment, add value to variable in different class

currently doing an assignemnt but i'm new to programming so was wondering how you add a value to a variable in a different class which already has an existing class

currently doing an assignemnt but i'm new to programming so was wondering how you add a value to a variable in a different class which already has an existing class

class OtherClass
    {
    int a;
    }
    public class Main Class
    {
        public static void main(String[] args) {
    int b = 7;
    OtherClass temp = new OtherClass();
    OtherClass.a = 5
    OtherClass.put(b) //this is where I'm not sure how to add b to a


Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Java Fundamentals: Learn Java for absolute beginners |Simpliv

Java Fundamentals: Learn Java for absolute beginners

Java Essentials : Learn Core Java From Basic to Advance

Learn Java Programming Using Practical Assignments. Start Building Back-end Web Applications Robust Test Automation Frameworks By End Of The Course. Learn More!

Fundamentos de Java: Aprende Java desde cero, sin misterios | Simpliv

Fundamentos de Java: Aprende Java desde cero, sin misterios