Question: 2 . int x = 1 , y = 7 , z = 5 ; for ( int i = 0 ;i < 2 ;i

2. int x =1, y =7, z =5; for(int i=0;i<2;i++){ if (x >0){ if (y <5) System.out.println("message one"); } else { System.out.println("message two"); }} else if (z >6){ System.out.println("message three"); } else { System.out.println("message four"); } System.out.println("message five"); 3. public class Nesting int m, n; public Nesting(int x , int y){ m=x; n=y; } public int largest(){ if (m> n) return(m); else return(n); }} public static void main(String[] args) Nesting t=new Nesting(4,6); int large= t.largest(); System.out.println(Largest is + large); } II. Correct the Error in the Following Program: { public class emp XD18 loyee public static void main(String[] args){ D employee=new d(); d.customer(56,ali); d.department(7,8.6,9); } public void customer(String name, int age) System.out.println("Your name is"+name); System.out.println("Age is+age); public int department(double d, double t, int a){ System.out.println("I have java exam at 3:00"); Return(1.1); }}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!