Question: Assume you are given this code public class ClassA { public static int lucky = 7 , } public class ClassB { public void main
Assume you are given this code
public class ClassA
public static int lucky
public class ClassB
public void mainString args
Your code goes here.
You are to write a statement to print the value of the lucky variable from ClassA where indicated. Which of the following statements are an appropriate way to do that? Select all answers that apply.
ClassA myInstance new ClassA;
System out printlnmyInstance lucky;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
