67 011
Assignments Done
99,4%
Successfully Done
In November 2018

Answer to Question #3472 in Java | JSP | JSF for Y mukundareddy

Question #3472
(3) Write a program to declare some int variables and string variables as protected and public and access them in another class?
Expert's answer
public class Main {

public static void main(String[] args) {
Test
t=new Test();
t.a=5;
t.str="Hello word";
}

}

class
Test{
protected int a;
public String str;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions