Help මචන් Plz urgent

Consider the following program written in Java using a notepad to answer questions 7 - 9.
class MySelf{
private String name;
private int age;
MySelf(){}
MySelf(String a, int b){ name = a; age = b;}
public void setName( String n) {name = n;}
public void setAge( int a) { age = a;}
public void display(){ System.out.println(name + " " + age);}
}
public class DriverPro{
public static void main(String args[]){
MySelf singer= new MySelf("Whitney Houston", 38);
MySelf leader= new MySelf();
leader.display();
}
}
7) After saving the program by giving the file name MySelf.java, what is the output when compiled
using the following command?
javac MySelf.java
(a) MySelf.class (b) MySelf.java
(c) Myself.java (d) DriverPro.class
(e) error
8) After saving the program by giving the file name DriverPro.java, what would the output be when
compiled by using the following command?
javac DriverPro.java
(a) MySelf.class (b) MySelf.java
(c) Myself.java (d) DriverPro.class
(e) error
 
Select from among the following, correct variable declarations and initializations which are
accepted in Java.
(a) int myNum = 34; (b) long myValue=3456734555666;
(c) String homeTown = “Padukka”; (d) float decimalValues = 34.98;
(e) boolean flag= “True”;
12) Which of the following operators
 

Lalakajee

Well-known member
  • Jun 20, 2007
    3,061
    296
    83
    In my own heart
    රණසිOහගේ අප්පු;10683342 said:
    Select from among the following, correct variable declarations and initializations which are
    accepted in Java.
    (a) int myNum = 34; (b) long myValue=3456734555666;
    (c) String homeTown = “Padukka”; (d) float decimalValues = 34.98;
    (e) boolean flag= “True”;
    12) Which of the following operators

    ac

    BIT past papers karanawa wage!:P:P