Computer Knowledge
Programming Languages and Compilers
2,284 Questions
Programming languages and compilers involve the rules, syntax, and semantics used to write and execute software programs. Key areas include scripting languages, object oriented concepts, and parsing algorithms like top down parsers. Practice these computer science questions to build proficiency for technical and computer knowledge exams.
Object oriented languagesScripting languagesCompilers and parsersProgramming syntax
Programming Languages and Compilers Questions
-
lazy="true"
-
lazy="false"
-
lazy="on"
-
lazy="off"
A
Correct answer
Explanation
Batch fetching is a performance optimization used with lazy loading to avoid the n+1 select problem. When lazy="true", Hibernate can batch multiple lazy initialization requests into a single query. With lazy="false", data is eagerly loaded, making batch fetching unnecessary. Options C and D use invalid attribute values.
-
thread
-
node
-
both a and b
-
none of the above
C
Correct answer
Explanation
In Ab Initio, declare pages can be of both thread and node types. This flexibility allows declare pages to be used in different parallel processing contexts - thread-level for shared memory operations and node-level for distributed processing across partitions.
-
Localization
-
Globalization
-
Translate
-
Nationalize
B
Correct answer
Explanation
Globalization is the process of designing applications that are culture-neutral and language-neutral, supporting multiple locales without modification. Localization comes later, adapting the globalized application to specific cultures/regions. Translation and Nationalize are not technical terms in this context.
A
Correct answer
Explanation
In RPG/400 programming, arrays are declared in the E-spec (Extension specification). The E-spec is specifically designed for defining array characteristics including dimensions, and element sizes. Other specs like I (Input), F (File), or C (Calculation) serve different purposes.
C
Correct answer
Explanation
RPG/400 programs can use a maximum of 254 subroutines. This is a built-in limitation of the language. The 'Unlimited' option is incorrect as RPG/400 has specific maximum limits for various program elements including subroutines.
D
Correct answer
Explanation
RPG/400 programs can declare a maximum of 200 arrays. This is a specific limit within the language that programmers need to be aware of when designing data-intensive applications. The limit is higher than file limits because arrays are memory structures rather than file I/O objects.
B
Correct answer
Explanation
conio.h (Console Input/Output) is NOT an ANSI/ISO standard C header file. It was originally developed for DOS and Microsoft operating systems. Functions like clrscr(), getch(), and getche() from conio.h are platform-specific and not part of the standard C library, which uses stdio.h for input/output operations.
B
Correct answer
Explanation
conio.h (Console Input/Output) is NOT an ANSI/ISO standard C header file. It was originally developed for DOS and Microsoft operating systems. Functions like clrscr(), getch(), and getche() from conio.h are platform-specific and not part of the standard C library, which uses stdio.h for input/output operations.
-
Only local or packaged sub programs can be overloaded.
-
Overloading allows different functions with the same name that differ only in their return types.
-
Overloading allows different subprograms with the same number, type and order of the parameter.
-
Overloading allows different subprograms with the same name and same number or type of the parameters.
-
Overloading allows different subprograms with the same name but different in either number or type or order of parameter.
A,E
Correct answer
Explanation
PL/SQL package subprogram overloading allows multiple subprograms (procedures or functions) to share the same name, provided their formal parameters differ in number, data type, or order. Overloading cannot be done based solely on differing return types, and standalone subprograms cannot be overloaded.
-
Packages can be nested.
-
You can pass parameters to packages.
-
A package is loaded into memory each time it is invoked.
-
The contents of packages can be shared by many applications.
-
You can achieve information hiding by making package constructs private.
D,E
Correct answer
Explanation
Package contents can be shared across multiple applications (D), and packages support information hiding by allowing private constructs not exposed to the outside (E). Packages cannot be nested (A), you pass parameters to package subprograms not the package itself (B), and packages load once per session not each time (C).
B
Correct answer
Explanation
In PL/SQL packages, identifiers declared only in the package body (not in the specification) are private constructs, not public. They are invisible outside the package body. Public constructs must be declared in the package specification.
-
End Points
-
Web Reference
-
Directly referring the URL
-
All of the above
A
Correct answer
Explanation
WCF services are structurally exposed to external clients using endpoints, which consist of an Address, Binding, and Contract (ABC). Web references and direct URL references are client-side techniques for consuming services rather than exposing them.
C
Correct answer
Explanation
Windows Phone 7 application development used C# as the primary programming language, along with XAML for UI markup. Silverlight for Windows Phone provided a subset of the Silverlight framework, and C# was the official language for WP7 app development in Visual Studio 2010.
-
Byte Code
-
Firewall
-
Class Code
-
Bit Code
A
Correct answer
Explanation
Java programs achieve platform independence by compiling source code into bytecode. This bytecode runs on any system with a Java Virtual Machine (JVM). Bit code, class code, and firewall are not the names of this intermediate format.
-
DISPLAY A,DISPLAY B
-
DISPLAY A DISPLAY B
-
DISPLAY A DISPLAY B WITH NO ADVANCING
-
DISPLAY A WITH NO ADVANCING DISPLAY B
D
Correct answer
Explanation
To display two variables on the same line using separate DISPLAY statements, use WITH NO ADVANCING after the first DISPLAY statement. This prevents the cursor from moving to the next line after displaying A, so B appears on the same line. Without NO ADVANCING, each DISPLAY statement outputs on a new line. The correct syntax is 'DISPLAY A WITH NO ADVANCING' followed by 'DISPLAY B'.