Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Object oriented programming Lab Activity for Week 2 [T/F] [T/F] [T/F] [T/F] [T/F] 1. 1. [T/F] I. State whether the following statements are True or
Object oriented programming
Lab Activity for Week 2 [T/F] [T/F] [T/F] [T/F] [T/F] 1. 1. [T/F] I. State whether the following statements are True or False a. Java is a procedure oriented programming language. b. Java is an architectural neutral language. c. Java Virtual Machine is the interpreter in java. d. We can write java programs without a class. e. The execution of every java program starts from the main method. f. The Scanner class is used to create output objects. g. The java programs can run without compiling them. h. The classes built in the java library contain many packages. The main method is a dynamic method. The filename.class will be run by Java Virtual Machine. k. There must be only one main method and many classes in a java program. Some methods in java need not be specified with the return type. m. The users are allowed to create simple user defined types in java. n. The class definition may be empty in java. 6. Every java program will start its execution from main method. p. An instance of a class is called a method. q. The java compiler compiles .java file and gives the .class file. r. The true is a boolean value in java. s. It is possible to run a java application program without main method. |t. Binding data and methods together is called encapsulation. lu. A constructor of a class is used to initialize the data members. V. The Math class is defined in java.util package of java library. . [T [T [T/F] [T/F] [T/F] a) Find the output of the following code 1. public class Q1{ public static void main(String [] args) { System.out.println(2+2+"=result"); System.out.println("result="+2+2); } } 2. public class Q2 public static void main(String[] arg) { oolean bl=true; while(51){ int a=0; a++; System.out.println(a); bl=false;}}} 3. public class Q3 { public static void main(String[] arg) { int a=1; int b=4; int c=4; System.out.println("NCT+a+b+c); }} 4. public class Q4 static String a; static double b; public static void main(String[] arg) { System.out.println(a+b); } 5. public class Q5{ public static void main(String[] arg) { int a=3; while(a8) break; a+=4; System.out.println(a); }}} 6. public class Q6{ public static void main(String[] arg) ( double a=11.5; double b=0.5; System.out.println(a+b+FF); } } 7. public class Q7{ public static void main(String[] arg){ int i; for(i=1;ib; int d=c?a:b: System.out.println(d); }}Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started