Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

public class test{ public static void main(String[] args) { Class1 c = new Class1(Ali); } } class Class1{ private String name; Class1(){ name = Unassigned;

  1. public class test{
  2. public static void main(String[] args) {
  3. Class1 c = new Class1("Ali"); }
  4. }
  5. class Class1{
  6. private String name;
  7. Class1(){
  8. name = "Unassigned";
  9. System.out.print("The name is" + name);
  10. }
  11. }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions